fix(#2990): Do not check if buffer is buflisted in diagnostics.update() (#2998)

This ensures that LSP diagnostics of files which are not manually opened
by users are rendered by nvim-tree diagnostic indicators.

However when users attach an LSP to nvim-tree this will bring back
flashing as attempted to fix in #2980. Fixing this should probably done
by checking data passed via diagnostic events (DiagnosticChanged and
CocDiagnosticChanged).

Signed-off-by: des-b <66919647+des-b@users.noreply.github.com>
This commit is contained in:
des-b 2024-11-10 22:57:06 +01:00 committed by GitHub
parent c7639482a1
commit 28eac2801b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -169,10 +169,7 @@ function M.update()
log.profile_end(profile) log.profile_end(profile)
local bufnr = view.get_bufnr() local bufnr = view.get_bufnr()
local should_draw = bufnr local should_draw = bufnr and vim.api.nvim_buf_is_valid(bufnr) and vim.api.nvim_buf_is_loaded(bufnr)
and vim.api.nvim_buf_is_valid(bufnr)
and vim.api.nvim_buf_is_loaded(bufnr)
and vim.api.nvim_get_option_value("buflisted", { buf = bufnr })
if should_draw then if should_draw then
local explorer = core.get_explorer() local explorer = core.get_explorer()
if explorer then if explorer then