on master help sign in
flip symbol range in LSP goto commands (#6794)
c3e2db7Pascal Kuthe
helix-term/src/commands/lsp.rs+3−1
@@ -205,7 +205,9 @@ fn jump_to_location(
205 log::warn!("lsp position out of bounds - {:?}", location.range);
205 log::warn!("lsp position out of bounds - {:?}", location.range);
206 return;
206 return;
207 };
207 };
208+ // we flip the range so that the cursor sits on the start of the symbol
209+ // (for example start of the function).
208− doc.set_selection(view.id, Selection::single(new_range.anchor, new_range.head));
210+ doc.set_selection(view.id, Selection::single(new_range.head, new_range.anchor));
209 align_view(doc, view, Align::Center);
211 align_view(doc, view, Align::Center);
210}
212}
211
213