aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index ebdfdfde..e09a1c5b 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -2828,10 +2828,15 @@ fn push_jump(view: &mut View, doc: &Document) {
}
fn goto_line(cx: &mut Context) {
- goto_line_impl(cx.editor, cx.count)
+ if cx.count.is_some() {
+ let (view, doc) = current!(cx.editor);
+ push_jump(view, doc);
+
+ goto_line_without_jumplist(cx.editor, cx.count);
+ }
}
-fn goto_line_impl(editor: &mut Editor, count: Option<NonZeroUsize>) {
+fn goto_line_without_jumplist(editor: &mut Editor, count: Option<NonZeroUsize>) {
if let Some(count) = count {
let (view, doc) = current!(editor);
let text = doc.text().slice(..);
@@ -2848,7 +2853,6 @@ fn goto_line_impl(editor: &mut Editor, count: Option<NonZeroUsize>) {
.clone()
.transform(|range| range.put_cursor(text, pos, editor.mode == Mode::Select));
- push_jump(view, doc);
doc.set_selection(view.id, selection);
}
}