aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands/lsp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands/lsp.rs')
-rw-r--r--helix-term/src/commands/lsp.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index 8f139b3b..93ae2353 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -39,13 +39,15 @@ fn location_to_file_location(location: &lsp::Location) -> FileLocation {
}
// TODO: share with symbol picker(symbol.location)
-// TODO: need to use push_jump() before?
fn jump_to_location(
editor: &mut Editor,
location: &lsp::Location,
offset_encoding: OffsetEncoding,
action: Action,
) {
+ let (view, doc) = current!(editor);
+ push_jump(view, doc);
+
let path = match location.uri.to_file_path() {
Ok(path) => path,
Err(_) => {
@@ -93,9 +95,10 @@ fn sym_picker(
}
},
move |cx, symbol, action| {
- if current_path2.as_ref() == Some(&symbol.location.uri) {
- push_jump(cx.editor);
- } else {
+ let (view, doc) = current!(cx.editor);
+ push_jump(view, doc);
+
+ if current_path2.as_ref() != Some(&symbol.location.uri) {
let uri = &symbol.location.uri;
let path = match uri.to_file_path() {
Ok(path) => path,
@@ -518,7 +521,6 @@ 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)),