Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/keymaps/vim.json
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@
"m": "vim::PushHelixMatch",
"]": ["vim::PushHelixNext", { "around": true }],
"[": ["vim::PushHelixPrevious", { "around": true }],
"ctrl-s": "editor::SaveLocation",
"g q": "vim::PushRewrap",
"g w": "vim::PushRewrap", // not a helix default & clashes with helix `goto_word`
},
Expand Down
2 changes: 2 additions & 0 deletions crates/editor/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,8 @@ actions!(
WrapSelectionsInTag,
/// Aligns selections from different rows into the same column
AlignSelections,
/// Saves the current location to navigation history.
SaveLocation,
]
);

Expand Down
9 changes: 9 additions & 0 deletions crates/editor/src/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15984,6 +15984,15 @@ impl Editor {
self.nav_history.as_ref()
}

pub fn save_location(
&mut self,
_: &SaveLocation,
_window: &mut Window,
cx: &mut Context<Self>,
) {
self.create_nav_history_entry(cx);
}

pub fn create_nav_history_entry(&mut self, cx: &mut Context<Self>) {
self.push_to_nav_history(
self.selections.newest_anchor().head(),
Expand Down
1 change: 1 addition & 0 deletions crates/editor/src/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ impl EditorElement {
register_action(editor, window, Editor::unfold_all);
register_action(editor, window, Editor::fold_selected_ranges);
register_action(editor, window, Editor::set_mark);
register_action(editor, window, Editor::save_location);
register_action(editor, window, Editor::swap_selection_ends);
register_action(editor, window, Editor::show_completions);
register_action(editor, window, Editor::show_word_completions);
Expand Down
Loading