By moving the option check inside the BufferInit function, the user have
had a change to set the option before it's being checked.
inlayhints.BufferInit(bnr)
endif
+ # Show diagnostics on the status line
+ if opt.lspOptions.showDiagOnStatusLine
+ acmds->add({bufnr: bnr,
+ event: 'CursorMoved',
+ group: 'LSPBufferAutocmds',
+ cmd: 'LspShowCurrentDiagInStatusLine()'})
+ endif
+
autocmd_add(acmds)
enddef
g:loaded_lsp = 1
-import autoload '../autoload/lsp/options.vim'
+import '../autoload/lsp/options.vim'
import autoload '../autoload/lsp/lsp.vim'
# 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 options.lspOptions.showDiagOnStatusLine
- autocmd CursorMoved * lsp.LspShowCurrentDiagInStatusLine()
- endif
augroup END
# TODO: Is it needed to shutdown all the LSP servers when exiting Vim?