fix: remove diagnostics in help view

fixes #1088
This commit is contained in:
kiyan 2022-03-19 12:32:11 +01:00
parent a2fc2979f3
commit 3cf67c5849
2 changed files with 23 additions and 9 deletions

View File

@ -2,6 +2,7 @@ local view = require "nvim-tree.view"
local filters = require "nvim-tree.explorer.filters"
local renderer = require "nvim-tree.renderer"
local reloaders = require "nvim-tree.actions.reloaders"
local diagnostics = require "nvim-tree.diagnostics"
local M = {}
@ -22,7 +23,12 @@ end
function M.help()
view.toggle_help()
return renderer.draw()
renderer.draw()
if view.is_help_ui() then
diagnostics.clear()
else
diagnostics.update()
end
end
return M

View File

@ -103,16 +103,10 @@ local function is_using_coc()
return vim.g.coc_service_initialized == 1
end
function M.update()
if not M.enable or not core.get_explorer() or not view.is_buf_valid(view.get_bufnr()) then
function M.clear()
if not M.enable or not view.is_buf_valid(view.get_bufnr()) then
return
end
local buffer_severity
if is_using_coc() then
buffer_severity = from_coc()
else
buffer_severity = from_nvim_lsp()
end
if #signs then
vim.fn.sign_unplacelist(vim.tbl_map(function(sign)
@ -124,6 +118,20 @@ function M.update()
end, signs))
signs = {}
end
end
function M.update()
if not M.enable or not core.get_explorer() or not view.is_buf_valid(view.get_bufnr()) then
return
end
local buffer_severity
if is_using_coc() then
buffer_severity = from_coc()
else
buffer_severity = from_nvim_lsp()
end
M.clear()
for bufname, severity in pairs(buffer_severity) do
if 0 < severity and severity < 5 then
local node, line = utils.find_node(core.get_explorer().nodes, function(node)