on master help sign in
fix: Place the cursor on the start of the selected symbol

Fixes #626

commit607b92b2e374f7b19e167da6d417dc6ae25bafe8 authorBlaž Hrastnik <blaz@mxxn.io> dateSun 22 Aug 2021, 15:00 (5 years ago) parent59e0cee
1 file changed+3−1
helix-term/src/commands.rs+3−1
helix-term/src/commands.rs+3−1
@@ -2330,7 +2330,9 @@ fn symbol_picker(cx: &mut Context) {
23302330 if let Some(range) =
23312331 lsp_range_to_range(doc.text(), symbol.location.range, offset_encoding)
23322332 {
2333− doc.set_selection(view.id, Selection::single(range.anchor, range.head));
2333+ // we flip the range so that the cursor sits on the start of the symbol
2334+ // (for example start of the function).
2335+ doc.set_selection(view.id, Selection::single(range.head, range.anchor));
23342336 align_view(doc, view, Align::Center);
23352337 }
23362338 },