Unnamed repository; edit this file 'description' to name the repository.
commands: make goto next/prev add to the jumplist (#14467)
| -rw-r--r-- | helix-term/src/commands.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 8edf5944..430d4430 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -3870,6 +3870,7 @@ fn goto_column_impl(cx: &mut Context, movement: Movement) { let pos = graphemes::nth_next_grapheme_boundary(text, line_start, count - 1).min(line_end); range.put_cursor(text, pos, movement == Movement::Extend) }); + push_jump(view, doc); doc.set_selection(view.id, selection); } @@ -3891,6 +3892,7 @@ fn goto_last_modification(cx: &mut Context) { .selection(view.id) .clone() .transform(|range| range.put_cursor(text, pos, cx.editor.mode == Mode::Select)); + push_jump(view, doc); doc.set_selection(view.id, selection); } } @@ -3942,6 +3944,7 @@ fn goto_first_diag(cx: &mut Context) { Some(diag) => Selection::single(diag.range.start, diag.range.end), None => return, }; + push_jump(view, doc); doc.set_selection(view.id, selection); view.diagnostics_handler .immediately_show_diagnostic(doc, view.id); @@ -3953,6 +3956,7 @@ fn goto_last_diag(cx: &mut Context) { Some(diag) => Selection::single(diag.range.start, diag.range.end), None => return, }; + push_jump(view, doc); doc.set_selection(view.id, selection); view.diagnostics_handler .immediately_show_diagnostic(doc, view.id); @@ -3976,6 +3980,7 @@ fn goto_next_diag(cx: &mut Context) { Some(diag) => Selection::single(diag.range.start, diag.range.end), None => return, }; + push_jump(view, doc); doc.set_selection(view.id, selection); view.diagnostics_handler .immediately_show_diagnostic(doc, view.id); @@ -4005,6 +4010,7 @@ fn goto_prev_diag(cx: &mut Context) { Some(diag) => Selection::single(diag.range.end, diag.range.start), None => return, }; + push_jump(view, doc); doc.set_selection(view.id, selection); view.diagnostics_handler .immediately_show_diagnostic(doc, view.id); @@ -4035,6 +4041,7 @@ fn goto_first_change_impl(cx: &mut Context, reverse: bool) { }; if hunk != Hunk::NONE { let range = hunk_range(hunk, doc.text().slice(..)); + push_jump(view, doc); doc.set_selection(view.id, Selection::single(range.anchor, range.head)); } } @@ -4090,6 +4097,7 @@ fn goto_next_change_impl(cx: &mut Context, direction: Direction) { } }); + push_jump(view, doc); doc.set_selection(view.id, selection) }; cx.editor.apply_motion(motion); @@ -5912,6 +5920,7 @@ fn goto_ts_object_impl(cx: &mut Context, object: &'static str, direction: Direct } }); + push_jump(view, doc); doc.set_selection(view.id, selection); } else { editor.set_status("Syntax-tree is not available in current buffer"); |