We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 951b6e7 commit cdbd7daCopy full SHA for cdbd7da
lua/nvim-tree/modified.lua
@@ -9,10 +9,16 @@ function M.reload()
9
local bufs = vim.fn.getbufinfo { bufmodified = true, buflisted = true }
10
for _, buf in pairs(bufs) do
11
local path = buf.name
12
- M._record[path] = true
13
- while path ~= vim.fn.getcwd() and path ~= "/" do
14
- path = vim.fn.fnamemodify(path, ":h")
15
+ if path ~= "" then -- not a [No Name] buffer
+ -- mark all the parent as modified as well
+ while
+ M._record[path] ~= true
16
+ -- no need to keep going if already recorded
17
+ -- This also prevents an infinite loop
18
+ do
19
+ M._record[path] = true
20
+ path = vim.fn.fnamemodify(path, ":h")
21
+ end
22
end
23
24
0 commit comments