Add a way to navigate between changes (#28891)

Closes https://github.com/zed-industries/zed/issues/19731

Adds `editor::GoToPreviousChange` and `editor::GoToNextChange` that work
the same as `vim::ChangeListOlder` and `vim::ChangeListNewer` as the
common logic was extracted and reused.

Release Notes:

- Added a way to navigate between changes with
`editor::GoToPreviousChange` and `editor::GoToNextChange`
This commit is contained in:
Kirill Bulatov 2025-04-16 14:09:17 -06:00 committed by GitHub
parent 64a67a1071
commit 56856fb992
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 178 additions and 67 deletions

View file

@ -323,8 +323,6 @@ pub(crate) struct Vim {
pub(crate) replacements: Vec<(Range<editor::Anchor>, String)>,
pub(crate) stored_visual_mode: Option<(Mode, Vec<bool>)>,
pub(crate) change_list: Vec<Vec<Anchor>>,
pub(crate) change_list_position: Option<usize>,
pub(crate) current_tx: Option<TransactionId>,
pub(crate) current_anchor: Option<Selection<Anchor>>,
@ -370,8 +368,6 @@ impl Vim {
replacements: Vec::new(),
stored_visual_mode: None,
change_list: Vec::new(),
change_list_position: None,
current_tx: None,
current_anchor: None,
undo_modes: HashMap::default(),