aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authoryzwduck2022-06-05 10:44:55 +0000
committerGitHub2022-06-05 10:44:55 +0000
commitd24ca66dbb5e67ed609f7b2cf11abaee05beaef7 (patch)
treea1e2be123ebd708ae32242fb785b0427528cba84 /helix-term/src
parent026241cf72df9a684ec889a146bead9266dba374 (diff)
Avoid modifying jumplist until jumping to ref (#2670)
When a goto command is cancelled, the jumplist should remain unchanged. This commit delays saving the current selection to the jumplist until jumping to a reference.
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands/lsp.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index bfedb209..8f139b3b 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -485,8 +485,6 @@ fn goto_impl(
locations: Vec<lsp::Location>,
offset_encoding: OffsetEncoding,
) {
- push_jump(editor);
-
let cwdir = std::env::current_dir().expect("couldn't determine current directory");
match locations.as_slice() {
@@ -520,6 +518,7 @@ fn goto_impl(
format!("{}:{}", file, line).into()
},
move |cx, location, action| {
+ push_jump(cx.editor);
jump_to_location(cx.editor, location, offset_encoding, action)
},
move |_editor, location| Some(location_to_file_location(location)),