Skip to content

Commit

Permalink
fix(#2990): Do not check if buffer is buflisted in diagnostics.update…
Browse files Browse the repository at this point in the history
…() (#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 <[email protected]>
  • Loading branch information
des-b authored Nov 10, 2024
1 parent c763948 commit 28eac28
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lua/nvim-tree/diagnostics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ function M.update()
log.profile_end(profile)

local bufnr = view.get_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_get_option_value("buflisted", { buf = bufnr })
local should_draw = bufnr and vim.api.nvim_buf_is_valid(bufnr) and vim.api.nvim_buf_is_loaded(bufnr)
if should_draw then
local explorer = core.get_explorer()
if explorer then
Expand Down

0 comments on commit 28eac28

Please sign in to comment.