fix(view): autosave periodically resetting scroll (#1476)

This commit is contained in:
Paul Delafosse 2022-10-11 22:19:31 +02:00 committed by GitHub
parent d5560f8f32
commit 181764f96c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 7 deletions

View File

@ -744,13 +744,17 @@ fn event(
{
ctx.set_handled();
}
self.ensure_cursor_visible(
ctx,
&editor_data,
&data.panel,
None,
env,
);
// We don't want to send this on `FocusCommand::Save`, especially when autosave is enabled.
if command.kind != CommandKind::Focus(FocusCommand::Save) {
self.ensure_cursor_visible(
ctx,
&editor_data,
&data.panel,
None,
env,
);
}
}
Event::Command(cmd) if cmd.is(LAPCE_UI_COMMAND) => {
let cmd = cmd.get_unchecked(LAPCE_UI_COMMAND);