vim: Single quote mark (#27231)

Closes #22398

Release Notes:

- vim: Adds `'` and `"` marks (last location jumped from in the current
buffer, and location when last exiting a buffer)

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
AidanV 2025-03-21 22:45:57 -07:00 committed by GitHub
parent d82b547596
commit fa677bdc38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 88 additions and 3 deletions

View file

@ -822,6 +822,19 @@ impl Vim {
EditorEvent::Edited { .. } => self.push_to_change_list(window, cx),
EditorEvent::FocusedIn => self.sync_vim_settings(window, cx),
EditorEvent::CursorShapeChanged => self.cursor_shape_changed(window, cx),
EditorEvent::PushedToNavHistory {
anchor,
is_deactivate,
} => {
self.update_editor(window, cx, |vim, editor, window, cx| {
let mark = if *is_deactivate {
"\"".to_string()
} else {
"'".to_string()
};
vim.set_mark(mark, vec![*anchor], editor.buffer(), window, cx);
});
}
_ => {}
}
}