flip symbol range in LSP goto commands (#6794)

pull/6837/head
Pascal Kuthe 2 years ago committed by GitHub
parent 13cc44c65e
commit c3e2db77f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -205,7 +205,9 @@ fn jump_to_location(
log::warn!("lsp position out of bounds - {:?}", location.range); log::warn!("lsp position out of bounds - {:?}", location.range);
return; 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); align_view(doc, view, Align::Center);
} }

Loading…
Cancel
Save