Fix off-by-one in select symbol references (#7132)

This commit is contained in:
Matthew Toohey 2023-05-25 08:01:56 -04:00 committed by GitHub
parent 8e2660b5cc
commit 207829eefe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1484,7 +1484,7 @@ pub fn select_references_to_symbol_under_cursor(cx: &mut Context) {
};
let (view, doc) = current!(editor);
let text = doc.text();
let pos = doc.selection(view.id).primary().head;
let pos = doc.selection(view.id).primary().cursor(text.slice(..));
// We must find the range that contains our primary cursor to prevent our primary cursor to move
let mut primary_index = 0;