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:
parent
d82b547596
commit
fa677bdc38
5 changed files with 88 additions and 3 deletions
|
@ -2147,6 +2147,7 @@ impl Editor {
|
|||
self.push_to_nav_history(
|
||||
*old_cursor_position,
|
||||
Some(new_cursor_position.to_point(buffer)),
|
||||
false,
|
||||
cx,
|
||||
);
|
||||
|
||||
|
@ -10809,10 +10810,15 @@ impl Editor {
|
|||
self.nav_history.as_ref()
|
||||
}
|
||||
|
||||
pub fn create_nav_history_entry(&mut self, cx: &mut Context<Self>) {
|
||||
self.push_to_nav_history(self.selections.newest_anchor().head(), None, false, cx);
|
||||
}
|
||||
|
||||
fn push_to_nav_history(
|
||||
&mut self,
|
||||
cursor_anchor: Anchor,
|
||||
new_position: Option<Point>,
|
||||
is_deactivate: bool,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
if let Some(nav_history) = self.nav_history.as_mut() {
|
||||
|
@ -10838,6 +10844,10 @@ impl Editor {
|
|||
}),
|
||||
cx,
|
||||
);
|
||||
cx.emit(EditorEvent::PushedToNavHistory {
|
||||
anchor: cursor_anchor,
|
||||
is_deactivate,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18617,6 +18627,10 @@ pub enum EditorEvent {
|
|||
},
|
||||
Reloaded,
|
||||
CursorShapeChanged,
|
||||
PushedToNavHistory {
|
||||
anchor: Anchor,
|
||||
is_deactivate: bool,
|
||||
},
|
||||
}
|
||||
|
||||
impl EventEmitter<EditorEvent> for Editor {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue