fix editor focus issue
@@ -496,10 +496,6 @@ fn event(
return;
}
- let editor = data.main_split.editors.get(&self.view_id).unwrap().clone();
- let mut editor_data = data.editor_view_content(self.view_id);
- let doc = editor_data.doc.clone();
-
match event {
Event::MouseDown(mouse_event) => match mouse_event.button {
druid::MouseButton::Left => {
@@ -514,6 +510,7 @@ fn event(
let command = cmd.get_unchecked(LAPCE_UI_COMMAND);
if let LapceUICommand::Focus = command {
self.request_focus(ctx, data, true);
+ let editor_data = data.editor_view_content(self.view_id);
self.ensure_cursor_visible(
ctx,
&editor_data,
@@ -526,6 +523,10 @@ fn event(
_ => (),
}
+ let editor = data.main_split.editors.get(&self.view_id).unwrap().clone();
+ let mut editor_data = data.editor_view_content(self.view_id);
+ let doc = editor_data.doc.clone();
+
match event {
Event::KeyDown(key_event) => {
ctx.set_handled();
