]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
After displaying the signature popup, the LSP commands for the current buffer stop...
authorYegappan Lakshmanan <yegappan@yahoo.com>
Tue, 18 Jan 2022 03:38:17 +0000 (19:38 -0800)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Tue, 18 Jan 2022 03:38:17 +0000 (19:38 -0800)
plugin/lsp.vim

index 9ece51bc347c25d832a124b841fca3c064a0998c..63cb3808e88074a6bdac4a25100cd5c5a979be96 100644 (file)
@@ -17,8 +17,10 @@ endif
 
 augroup LSPAutoCmds
   au!
-  autocmd BufNewFile,BufReadPost * lsp#addFile(bufnr('%'))
-  autocmd BufWipeOut * lsp#removeFile(bufnr('%'))
+  autocmd BufNewFile,BufReadPost * lsp#addFile(expand('<abuf>')->str2nr())
+  # Note that when BufWipeOut is invoked, the current buffer may be different
+  # from the buffer getting wiped out.
+  autocmd BufWipeOut * lsp#removeFile(expand('<abuf>')->str2nr())
   if opt.lspOptions.showDiagOnStatusLine
     autocmd CursorMoved * lsp#showCurrentDiagInStatusLine()
   endif