parent
a2fc2979f3
commit
3cf67c5849
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user