Skip to content

Commit f75914d

Browse files
author
Daniel Hakimian
committed
Fix cursor positioning when jumping to next/prev reference
On tab-indented lines, (or any line where column number and virtual column number are different) `|` puts the cursor on the nth virtual column, not the nth character of the line. This caused the Lsp{Next,Previous}Reference commands to place the cursor on the wrong column on tab-indented lines.
1 parent 900e861 commit f75914d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autoload/lsp/ui/vim/references.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,5 @@ function! lsp#ui#vim#references#jump(offset) abort
221221

222222
" Jump
223223
let l:target = w:lsp_reference_positions[l:index][0:1]
224-
silent exec 'normal! ' . l:target[0] . 'G' . l:target[1] . '|'
224+
silent exec 'normal! ' . l:target[0] . 'G0' . (l:target[1] == 1 ? '' : l:target[1]-1 . 'l')
225225
endfunction

0 commit comments

Comments
 (0)