Release Notes:

- vim: Added support for the changelist. `g;` and `g,` to the
previous/next change
- vim: Added support for the `'.` mark
- vim: Added support for `gi` to resume the previous insert
This commit is contained in:
Conrad Irwin 2024-05-09 21:18:56 -06:00 committed by GitHub
parent 4f9ba28a25
commit 45f12b9426
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 326 additions and 10 deletions

View file

@ -68,9 +68,11 @@ pub fn create_mark_before(vim: &mut Vim, text: Arc<str>, cx: &mut WindowContext)
}
pub fn jump(text: Arc<str>, line: bool, cx: &mut WindowContext) {
let anchors = match &*text {
"{" | "}" => Vim::update(cx, |vim, cx| {
vim.update_active_editor(cx, |_, editor, cx| {
let anchors = Vim::update(cx, |vim, cx| {
vim.pop_operator(cx);
match &*text {
"{" | "}" => vim.update_active_editor(cx, |_, editor, cx| {
let (map, selections) = editor.selections.all_display(cx);
selections
.into_iter()
@ -84,13 +86,10 @@ pub fn jump(text: Arc<str>, line: bool, cx: &mut WindowContext) {
.anchor_before(point.to_offset(&map, Bias::Left))
})
.collect::<Vec<Anchor>>()
})
}),
_ => Vim::read(cx).state().marks.get(&*text).cloned(),
};
Vim::update(cx, |vim, cx| {
vim.pop_operator(cx);
}),
"." => vim.state().change_list.last().cloned(),
_ => vim.state().marks.get(&*text).cloned(),
}
});
let Some(anchors) = anchors else { return };