]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Use the FileType autocmd to start the LSP server for a buffer
authorYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 25 Jun 2023 23:42:45 +0000 (16:42 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Sun, 25 Jun 2023 23:42:45 +0000 (16:42 -0700)
plugin/lsp.vim

index ce9c7040f04df1d3d67f00ea0df34cdc9dc6a51f..d89f3ae779d2df2388af5e6ed51c13ac3f07b79d 100644 (file)
@@ -45,7 +45,7 @@ enddef
 
 augroup LSPAutoCmds
   au!
-  autocmd BufNewFile,BufReadPost * lsp.AddFile(expand('<abuf>')->str2nr())
+  autocmd BufNewFile,BufReadPost,FileType * 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())