fix(diagnostics): do not show on file/dir with same prefix
This commit is contained in:
@@ -108,16 +108,15 @@ function M.update()
|
|||||||
end
|
end
|
||||||
|
|
||||||
for bufname, severity in pairs(buffer_severity) do
|
for bufname, severity in pairs(buffer_severity) do
|
||||||
local bufpath = vim.fn.fnamemodify(utils.canonical_path(bufname), ":p")
|
local bufpath = utils.canonical_path(bufname)
|
||||||
log.line("diagnostics", " bufpath '%s' severity %d", bufpath, severity)
|
log.line("diagnostics", " bufpath '%s' severity %d", bufpath, severity)
|
||||||
if 0 < severity and severity < 5 then
|
if 0 < severity and severity < 5 then
|
||||||
for line, node in pairs(nodes_by_line) do
|
for line, node in pairs(nodes_by_line) do
|
||||||
local nodepath = vim.fn.fnamemodify(utils.canonical_path(node.absolute_path), ":p")
|
local nodepath = utils.canonical_path(node.absolute_path)
|
||||||
log.line("diagnostics", " %d checking nodepath '%s'", line, nodepath)
|
log.line("diagnostics", " %d checking nodepath '%s'", line, nodepath)
|
||||||
if
|
if
|
||||||
M.show_on_dirs
|
M.show_on_dirs
|
||||||
and node.nodes
|
and vim.startswith(bufpath:gsub("\\", "/"), nodepath:gsub("\\", "/") .. "/")
|
||||||
and vim.startswith(bufpath, nodepath)
|
|
||||||
and (not node.open or M.show_on_open_dirs)
|
and (not node.open or M.show_on_open_dirs)
|
||||||
then
|
then
|
||||||
log.line("diagnostics", " matched fold node '%s'", node.absolute_path)
|
log.line("diagnostics", " matched fold node '%s'", node.absolute_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user