From 58c75a7c4d3d762d9450ac9c0dfff1e4d6940987 Mon Sep 17 00:00:00 2001 From: kohnish Date: Mon, 24 Jan 2022 22:08:30 +0100 Subject: [PATCH] Ctrl + O coming back to wrong location when jump was within the same file --- autoload/symbol.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.48.1