From 207829eefee51095d1c7b424cf11cab694fbf52b Mon Sep 17 00:00:00 2001 From: Matthew Toohey Date: Thu, 25 May 2023 08:01:56 -0400 Subject: Fix off-by-one in select symbol references (#7132) --- helix-term/src/commands/lsp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 948f3484..3596df45 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -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; -- cgit v1.2.3-70-g09d2