Skip to content

Commit fee6801

Browse files
committed
fix(diagnostics): do not show on file/dir with same prefix
1 parent 3000797 commit fee6801

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lua/nvim-tree/diagnostics.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,15 @@ function M.update()
108108
end
109109

110110
for bufname, severity in pairs(buffer_severity) do
111-
local bufpath = vim.fn.fnamemodify(utils.canonical_path(bufname), ":p")
111+
local bufpath = utils.canonical_path(bufname)
112112
log.line("diagnostics", " bufpath '%s' severity %d", bufpath, severity)
113113
if 0 < severity and severity < 5 then
114114
for line, node in pairs(nodes_by_line) do
115-
local nodepath = vim.fn.fnamemodify(utils.canonical_path(node.absolute_path), ":p")
115+
local nodepath = utils.canonical_path(node.absolute_path)
116116
log.line("diagnostics", " %d checking nodepath '%s'", line, nodepath)
117117
if
118118
M.show_on_dirs
119-
and node.nodes
120-
and vim.startswith(bufpath, nodepath)
119+
and vim.startswith(bufpath:gsub("\\", "/"), nodepath:gsub("\\", "/") .. "/")
121120
and (not node.open or M.show_on_open_dirs)
122121
then
123122
log.line("diagnostics", " matched fold node '%s'", node.absolute_path)

0 commit comments

Comments
 (0)