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 Schuyler Mortimer committed Jul 10, 2024
1 parent 956c55e commit 5b697c2
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 5b697c2

Please sign in to comment.