From: kohnish Date: Mon, 24 Jan 2022 21:08:30 +0000 (+0100) Subject: Ctrl + O coming back to wrong location when jump was within the same file X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=58c75a7c4d3d762d9450ac9c0dfff1e4d6940987;p=vim-lsp.git Ctrl + O coming back to wrong location when jump was within the same file --- diff --git a/autoload/symbol.vim b/autoload/symbol.vim index 812fe02..2bdb062 100644 --- a/autoload/symbol.vim +++ b/autoload/symbol.vim @@ -261,6 +261,7 @@ export def GotoSymbol(lspserver: dict, location: dict, 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, location: dict, 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