autoload/lsp/util.vim | 9 +++++---- diff --git a/autoload/lsp/util.vim b/autoload/lsp/util.vim index 0e18dcf44b08120f1defb5d263d9195d5570a3b6..9343d4e0008d38f0d34fe3506786d094e59ed8bb 100644 --- a/autoload/lsp/util.vim +++ b/autoload/lsp/util.vim @@ -172,7 +172,11 @@ # jump to the file and line containing the symbol if cmdmods == '' var bnr: number = fname->bufnr() - if bnr != bufnr() + if bnr == bufnr() + # Set the previous cursor location mark. Instead of using setpos(), m' is + # used so that the current location is added to the jump list. + normal m' + else var wid = fname->bufwinid() if wid != -1 wid->win_gotoid() @@ -201,9 +205,6 @@ endif else exe $'{cmdmods} split {fname}' endif - # Set the previous cursor location mark. Instead of using setpos(), m' is - # used so that the current location is added to the jump list. - normal m' setcursorcharpos(range.start.line + 1, range.start.character + 1) enddef