From 6b3c9d8ed37fd36f8be8c217ec2c71fb73de63e7 Mon Sep 17 00:00:00 2001 From: Ivan Tham Date: Wed, 9 Jun 2021 00:40:38 +0800 Subject: Fix jump behavior, goto_implementation now jump Better jump behavior since we override the first jump if it's on the first document. At the same time, ctrl-i is now working with gd jumps. --- helix-term/src/commands.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'helix-term/src/commands.rs') diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 810c98c1..3358f9d2 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -1308,7 +1308,7 @@ pub fn normal_mode(cx: &mut Context) { // Store a jump on the jumplist. fn push_jump(editor: &mut Editor) { let (view, doc) = editor.current(); - let jump = { (doc.id(), doc.selection(view.id).clone()) }; + let jump = (doc.id(), doc.selection(view.id).clone()); view.jumps.push(jump); } @@ -2446,7 +2446,7 @@ pub fn jump_backward(cx: &mut Context) { let count = cx.count(); let (view, doc) = cx.current(); - if let Some((id, selection)) = view.jumps.backward(count) { + if let Some((id, selection)) = view.jumps.backward(view.id, doc, count) { view.doc = *id; let selection = selection.clone(); let (view, doc) = cx.current(); // refetch doc -- cgit v1.2.3-70-g09d2