ensure cusror visible when editor got focus
@@ -497,6 +497,9 @@ 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::MouseDown(mouse_event) => match mouse_event.button {
druid::MouseButton::Left => {
@@ -511,14 +514,18 @@ fn event(
let command = cmd.get_unchecked(LAPCE_UI_COMMAND);
if let LapceUICommand::Focus = command {
self.request_focus(ctx, data, true);
+ self.ensure_cursor_visible(
+ ctx,
+ &editor_data,
+ &data.panels,
+ None,
+ env,
+ );
}
}
_ => (),
}
- 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();
