Skip to content

Commit

Permalink
flip symbol range in LSP goto commands (helix-editor#6794)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe authored and Triton171 committed Jun 18, 2023
1 parent 0979710 commit 0fdc3ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helix-term/src/commands/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ fn jump_to_location(
log::warn!("lsp position out of bounds - {:?}", location.range);
return;
};
doc.set_selection(view.id, Selection::single(new_range.anchor, new_range.head));
// we flip the range so that the cursor sits on the start of the symbol
// (for example start of the function).
doc.set_selection(view.id, Selection::single(new_range.head, new_range.anchor));
align_view(doc, view, Align::Center);
}

Expand Down

0 comments on commit 0fdc3ab

Please sign in to comment.