From: shane.xb.qian Date: Wed, 26 Oct 2022 22:51:59 +0000 (+0800) Subject: clarify the comment about symbol jump if same buf had in cur win X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3e85f41c895b2d4b52459e29e4c35595d4bc37d6;p=vim-lsp.git clarify the comment about symbol jump if same buf had in cur win --- diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim index 1480aad..f4c4ca5 100644 --- a/autoload/lsp/symbol.vim +++ b/autoload/lsp/symbol.vim @@ -103,13 +103,16 @@ def JumpToWorkspaceSymbol(popupID: number, result: number): void else var wid = fname->bufwinid() if wid != -1 + # if had one in cur tab + # and cur win is same buf if bufwinid(bufnr()) == wid - # do nothing if cur one is + # do nothing else - # jump to one in cur tab + # or pick up one in cur tab wid->win_gotoid() endif else + # or pick up one in one tab winList[0]->win_gotoid() endif endif @@ -301,7 +304,10 @@ export def GotoSymbol(lspserver: dict, location: dict, peekSymbol: boo # jump to the file and line containing the symbol var wid = fname->bufwinid() if wid != -1 - # do not jump if cur one is same buf + # `wid` maybe just is one of windows in cur tab which had same buf + # jump to `wid` only if cur one is not same buf or maybe a bit mess + # which should always try to re-use cur one firstly (if it is same) + # otherwise cursor perhaps dumbly jumpped to `wid` though same buf if bufwinid(bufnr()) != wid wid->win_gotoid() endif