Skip to content

Commit ce67acf

Browse files
committed
chore: resolve undefined-field
1 parent 47e5d0e commit ce67acf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/nvim-tree/marks/init.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ function Marks:navigate(up)
200200

201201
Iterator.builder(self.explorer.nodes)
202202
:recursor(function(n)
203-
return n.open and n.nodes
203+
local dir = n:as(DirectoryNode)
204+
return dir and dir.open and dir.nodes
204205
end)
205206
:applier(function(n)
206207
if n.absolute_path == node.absolute_path then
@@ -263,7 +264,7 @@ function Marks:navigate_select()
263264
return
264265
end
265266
local node = self.marks[choice]
266-
if node and not node.nodes and not utils.get_win_buf_from_path(node.absolute_path) then
267+
if node and not node:is(DirectoryNode) and not utils.get_win_buf_from_path(node.absolute_path) then
267268
open_file.fn("edit", node.absolute_path)
268269
elseif node then
269270
utils.focus_file(node.absolute_path)

0 commit comments

Comments
 (0)