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 735381a commit 01f66abCopy full SHA for 01f66ab
lua/nvim-tree/actions/tree/modifiers/collapse-all.lua
@@ -3,6 +3,8 @@ local core = require("nvim-tree.core")
3
local lib = require("nvim-tree.lib")
4
local Iterator = require("nvim-tree.iterators.node-iterator")
5
6
+local DirectoryNode = require("nvim-tree.node.directory")
7
+
8
local M = {}
9
10
---@return fun(path: string): boolean
@@ -36,8 +38,9 @@ function M.fn(keep_buffers)
36
38
Iterator.builder(explorer.nodes)
37
39
:hidden()
40
:applier(function(n)
- if n.nodes ~= nil then
- n.open = keep_buffers == true and matches(n.absolute_path)
41
+ local dir = n:as(DirectoryNode)
42
+ if dir then
43
+ dir.open = keep_buffers and matches(dir.absolute_path)
44
end
45
end)
46
:recursor(function(n)
0 commit comments