]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Ctrl + O coming back to wrong location when jump was within the same file
authorkohnish <kohnish@gmx.com>
Mon, 24 Jan 2022 21:08:30 +0000 (22:08 +0100)
committerkohnish <kohnish@gmx.com>
Mon, 24 Jan 2022 21:12:50 +0000 (22:12 +0100)
autoload/symbol.vim

index 812fe0284529a1ac8d4e2414dd1870db1d2fc6e3..2bdb062f6f8d037f481ccfe439bd3ff27b443c1c 100644 (file)
@@ -261,6 +261,7 @@ export def GotoSymbol(lspserver: dict<any>, location: dict<any>, type: string)
     var wid = fname->bufwinid()
     if wid != -1
       wid->win_gotoid()
+      normal! m`
     else
       var bnr: number = fname->bufnr()
       if bnr != -1
@@ -278,9 +279,9 @@ export def GotoSymbol(lspserver: dict<any>, location: dict<any>, type: string)
           exe 'edit  ' .. fname
         endif
       endif
+      setpos("'`", getcurpos())
     endif
     # Set the previous cursor location mark
-    setpos("'`", getcurpos())
     setcursorcharpos(location.range.start.line + 1,
                        location.range.start.character + 1)
   endif