From 93948151a0ce25e5fd032dc50ad1608eae212593 Mon Sep 17 00:00:00 2001 From: des-b <66919647+des-b@users.noreply.github.com> Date: Sun, 10 Nov 2024 11:54:37 +0100 Subject: [PATCH] fix(#2990): Do not check if buffer is buflisted in diagnostics.update() 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> --- lua/nvim-tree/diagnostics.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lua/nvim-tree/diagnostics.lua b/lua/nvim-tree/diagnostics.lua index 3d004765343..8e84ac6c4e5 100644 --- a/lua/nvim-tree/diagnostics.lua +++ b/lua/nvim-tree/diagnostics.lua @@ -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