Abandon ship

This commit is contained in:
Conrad Irwin 2023-11-14 16:16:02 -07:00
parent 6b25841e2a
commit 1109cd11c8
5 changed files with 1247 additions and 1249 deletions

View file

@ -1449,7 +1449,6 @@ impl EditorElement {
let snapshot = editor.snapshot(cx); let snapshot = editor.snapshot(cx);
let style = self.style.clone(); let style = self.style.clone();
dbg!(&style.text.font());
let font_id = cx.text_system().font_id(&style.text.font()).unwrap(); let font_id = cx.text_system().font_id(&style.text.font()).unwrap();
let font_size = style.text.font_size.to_pixels(cx.rem_size()); let font_size = style.text.font_size.to_pixels(cx.rem_size());
let line_height = style.text.line_height_in_pixels(cx.rem_size()); let line_height = style.text.line_height_in_pixels(cx.rem_size());

File diff suppressed because it is too large Load diff

View file

@ -15,7 +15,7 @@ use taffy::style::Overflow;
pub fn uniform_list<Id, V, C>( pub fn uniform_list<Id, V, C>(
id: Id, id: Id,
item_count: usize, item_count: usize,
f: impl 'static + Fn(&mut V, Range<usize>, &mut ViewContext<V>) -> SmallVec<[C; 64]>, f: impl 'static + Fn(&mut V, Range<usize>, &mut ViewContext<V>) -> Vec<C>,
) -> UniformList<V> ) -> UniformList<V>
where where
Id: Into<ElementId>, Id: Into<ElementId>,

View file

@ -21,7 +21,6 @@ use project::{
}; };
use project_panel_settings::{ProjectPanelDockPosition, ProjectPanelSettings}; use project_panel_settings::{ProjectPanelDockPosition, ProjectPanelSettings};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use smallvec::SmallVec;
use std::{ use std::{
cmp::Ordering, cmp::Ordering,
collections::{hash_map, HashMap}, collections::{hash_map, HashMap},
@ -1468,7 +1467,7 @@ impl Render for ProjectPanel {
.map(|(_, worktree_entries)| worktree_entries.len()) .map(|(_, worktree_entries)| worktree_entries.len())
.sum(), .sum(),
|this: &mut Self, range, cx| { |this: &mut Self, range, cx| {
let mut items = SmallVec::new(); let mut items = Vec::new();
this.for_each_visible_entry(range, cx, |id, details, cx| { this.for_each_visible_entry(range, cx, |id, details, cx| {
items.push(this.render_entry(id, details, cx)); items.push(this.render_entry(id, details, cx));
}); });

View file

@ -38,10 +38,10 @@ use futures::{
use gpui::{ use gpui::{
actions, div, point, rems, size, Action, AnyModel, AnyView, AnyWeakView, AppContext, actions, div, point, rems, size, Action, AnyModel, AnyView, AnyWeakView, AppContext,
AsyncAppContext, AsyncWindowContext, Bounds, Component, Div, Entity, EntityId, EventEmitter, AsyncAppContext, AsyncWindowContext, Bounds, Component, Div, Entity, EntityId, EventEmitter,
FocusHandle, FocusableKeyDispatch, GlobalPixels, KeyContext, Model, ModelContext, FocusHandle, GlobalPixels, KeyContext, Model, ModelContext, ParentElement, Point, Render, Size,
ParentElement, Point, Render, Size, StatefulInteractive, StatefulInteractivity, StatefulInteractive, StatelessInteractive, StatelessInteractivity, Styled, Subscription, Task,
StatelessInteractive, StatelessInteractivity, Styled, Subscription, Task, View, ViewContext, View, ViewContext, VisualContext, WeakView, WindowBounds, WindowContext, WindowHandle,
VisualContext, WeakView, WindowBounds, WindowContext, WindowHandle, WindowOptions, WindowOptions,
}; };
use item::{FollowableItem, FollowableItemHandle, Item, ItemHandle, ItemSettings, ProjectItem}; use item::{FollowableItem, FollowableItemHandle, Item, ItemHandle, ItemSettings, ProjectItem};
use itertools::Itertools; use itertools::Itertools;
@ -3037,10 +3037,10 @@ impl Workspace {
fn force_remove_pane(&mut self, pane: &View<Pane>, cx: &mut ViewContext<Workspace>) { fn force_remove_pane(&mut self, pane: &View<Pane>, cx: &mut ViewContext<Workspace>) {
self.panes.retain(|p| p != pane); self.panes.retain(|p| p != pane);
if true { self.panes
todo!() .last()
// cx.focus(self.panes.last().unwrap()); .unwrap()
} .update(cx, |pane, cx| pane.focus(cx));
if self.last_active_center_pane == Some(pane.downgrade()) { if self.last_active_center_pane == Some(pane.downgrade()) {
self.last_active_center_pane = None; self.last_active_center_pane = None;
} }
@ -3429,8 +3429,7 @@ impl Workspace {
node_runtime: FakeNodeRuntime::new(), node_runtime: FakeNodeRuntime::new(),
}); });
let workspace = Self::new(0, project, app_state, cx); let workspace = Self::new(0, project, app_state, cx);
dbg!(&workspace.focus_handle); workspace.active_pane.update(cx, |pane, cx| pane.focus(cx));
workspace.focus_handle.focus(cx);
workspace workspace
} }
@ -3709,7 +3708,7 @@ fn notify_if_database_failed(workspace: WindowHandle<Workspace>, cx: &mut AsyncA
impl EventEmitter<Event> for Workspace {} impl EventEmitter<Event> for Workspace {}
impl Render for Workspace { impl Render for Workspace {
type Element = Div<Self, StatefulInteractivity<Self>, FocusableKeyDispatch<Self>>; type Element = Div<Self>;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element { fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let mut context = KeyContext::default(); let mut context = KeyContext::default();
@ -3717,7 +3716,6 @@ impl Render for Workspace {
let ui_font = ThemeSettings::get_global(cx).ui_font.family.clone(); let ui_font = ThemeSettings::get_global(cx).ui_font.family.clone();
self.add_workspace_actions_listeners(div()) self.add_workspace_actions_listeners(div())
.track_focus(&self.focus_handle)
.context(context) .context(context)
.relative() .relative()
.size_full() .size_full()