autoload/lsp/symbol.vim | 12 +++++++++--- diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim index 1480aad1e2eda3102fb6144c080815f934df59ef..f4c4ca580973b758955f65f39e0d655ae13e5945 100644 --- a/autoload/lsp/symbol.vim +++ b/autoload/lsp/symbol.vim @@ -103,13 +103,16 @@ endif 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 @@ else # 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