Skip to content

Commit 0fdc3ab

Browse files
pascalkutheTriton171
authored andcommitted
flip symbol range in LSP goto commands (helix-editor#6794)
1 parent 0979710 commit 0fdc3ab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

helix-term/src/commands/lsp.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ fn jump_to_location(
205205
log::warn!("lsp position out of bounds - {:?}", location.range);
206206
return;
207207
};
208-
doc.set_selection(view.id, Selection::single(new_range.anchor, new_range.head));
208+
// we flip the range so that the cursor sits on the start of the symbol
209+
// (for example start of the function).
210+
doc.set_selection(view.id, Selection::single(new_range.head, new_range.anchor));
209211
align_view(doc, view, Align::Center);
210212
}
211213

0 commit comments

Comments
 (0)