Skip to content

Commit

Permalink
flip symbol range in LSP goto commands (#6794)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe authored Apr 21, 2023
1 parent 13cc44c commit c3e2db7
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 c3e2db7

Please sign in to comment.