From: Yegappan Lakshmanan Date: Sun, 18 Jun 2023 05:47:26 +0000 (-0700) Subject: Cursor not positioned correctly when jumping to a symbol in another file X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=93779a199dfa8e4843f0b846d300c0a70f062b03;p=vim-lsp.git Cursor not positioned correctly when jumping to a symbol in another file --- diff --git a/autoload/lsp/symbol.vim b/autoload/lsp/symbol.vim index ae19387..081af96 100644 --- a/autoload/lsp/symbol.vim +++ b/autoload/lsp/symbol.vim @@ -124,7 +124,7 @@ def JumpToWorkspaceSymbol(cmdmods: string, popupID: number, result: number): voi # used so that the current location is added to the jump list. :normal m' setcursorcharpos(symTbl[result - 1].pos.line + 1, - util.GetCharIdxWithoutCompChar(bnr, + util.GetCharIdxWithoutCompChar(bufnr(), symTbl[result - 1].pos) + 1) catch # ignore exceptions diff --git a/doc/lsp.txt b/doc/lsp.txt index 1185756..4040ad4 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -1301,7 +1301,9 @@ LspAttached A |User| autocommand fired when the LSP client LspDiagsUpdated A |User| autocommand invoked when new diagnostics are received from the language server. This is invoked after the LSP client - has processed the diagnostics. + has processed the diagnostics.  The function + lsp#diag#GetDiagsForBuf() can be used to get + all the diagnostics for a buffer. ============================================================================== 12. Highlight Groups *lsp-highlight-groups*