From 93779a199dfa8e4843f0b846d300c0a70f062b03 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sat, 17 Jun 2023 22:47:26 -0700 Subject: [PATCH] Cursor not positioned correctly when jumping to a symbol in another file --- autoload/lsp/symbol.vim | 2 +- doc/lsp.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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* -- 2.48.1