Pane focus working. Modals seem broken now

This commit is contained in:
K Simmons
2022-08-09 17:15:54 -07:00
parent 049149320c
commit 6f180ed822
11 changed files with 43 additions and 103 deletions
-3
View File
@@ -1561,7 +1561,6 @@ impl Editor {
) {
if !self.focused {
cx.focus_self();
cx.emit(Event::Activate);
}
let display_map = self.display_map.update(cx, |map, cx| map.snapshot(cx));
@@ -1623,7 +1622,6 @@ impl Editor {
) {
if !self.focused {
cx.focus_self();
cx.emit(Event::Activate);
}
let display_map = self.display_map.update(cx, |map, cx| map.snapshot(cx));
@@ -5969,7 +5967,6 @@ fn compute_scroll_position(
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Event {
Activate,
BufferEdited,
Edited,
Reparsed,
-4
View File
@@ -469,10 +469,6 @@ impl Item for Editor {
})
}
fn should_activate_item_on_event(event: &Event) -> bool {
matches!(event, Event::Activate)
}
fn should_close_item_on_event(event: &Event) -> bool {
matches!(event, Event::Closed)
}
+2 -3
View File
@@ -8,8 +8,8 @@ use util::TryFutureExt;
use workspace::Workspace;
use crate::{
Anchor, DisplayPoint, Editor, EditorSnapshot, Event, GoToDefinition, GoToTypeDefinition,
Select, SelectPhase,
Anchor, DisplayPoint, Editor, EditorSnapshot, GoToDefinition, GoToTypeDefinition, Select,
SelectPhase,
};
#[derive(Clone, PartialEq)]
@@ -355,7 +355,6 @@ fn go_to_fetched_definition_of_kind(
editor_handle.update(cx, |editor, cx| {
if !editor.focused {
cx.focus_self();
cx.emit(Event::Activate);
}
});
+1 -2
View File
@@ -2,7 +2,7 @@ use context_menu::ContextMenuItem;
use gpui::{geometry::vector::Vector2F, impl_internal_actions, MutableAppContext, ViewContext};
use crate::{
DisplayPoint, Editor, EditorMode, Event, FindAllReferences, GoToDefinition, GoToTypeDefinition,
DisplayPoint, Editor, EditorMode, FindAllReferences, GoToDefinition, GoToTypeDefinition,
Rename, SelectMode, ToggleCodeActions,
};
@@ -25,7 +25,6 @@ pub fn deploy_context_menu(
) {
if !editor.focused {
cx.focus_self();
cx.emit(Event::Activate);
}
// Don't show context menu for inline editors