on master help sign in
fix: Place the cursor on the start of the selected symbol
607b92bBlaž Hrastnik
helix-term/src/commands.rs+3−1
@@ -2330,7 +2330,9 @@ fn symbol_picker(cx: &mut Context) {
2330 if let Some(range) =
2330 if let Some(range) =
2331 lsp_range_to_range(doc.text(), symbol.location.range, offset_encoding)
2331 lsp_range_to_range(doc.text(), symbol.location.range, offset_encoding)
2332 {
2332 {
2333+ // we flip the range so that the cursor sits on the start of the symbol
2334+ // (for example start of the function).
2333− doc.set_selection(view.id, Selection::single(range.anchor, range.head));
2335+ doc.set_selection(view.id, Selection::single(range.head, range.anchor));
2334 align_view(doc, view, Align::Center);
2336 align_view(doc, view, Align::Center);
2335 }
2337 }
2336 },
2338 },