mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 05:27:07 +04:00
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.
This commit is contained in:
parent
026241cf72
commit
d24ca66dbb
@ -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)),
|
||||
|
Loading…
Reference in New Issue
Block a user