From e7b9c71f8f404d6c842fca2122af52c4fcf09696 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Fri, 25 Oct 2024 15:24:16 +1100 Subject: [PATCH] chore: resolve undefined-field --- lua/nvim-tree/marks/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/nvim-tree/marks/init.lua b/lua/nvim-tree/marks/init.lua index fde1e534..ddeb5cc9 100644 --- a/lua/nvim-tree/marks/init.lua +++ b/lua/nvim-tree/marks/init.lua @@ -200,7 +200,8 @@ function Marks:navigate(up) Iterator.builder(self.explorer.nodes) :recursor(function(n) - return n.open and n.nodes + local dir = n:as(DirectoryNode) + return dir and dir.open and dir.nodes end) :applier(function(n) if n.absolute_path == node.absolute_path then @@ -263,7 +264,7 @@ function Marks:navigate_select() return end local node = self.marks[choice] - if node and not node.nodes and not utils.get_win_buf_from_path(node.absolute_path) then + if node and not node:is(DirectoryNode) and not utils.get_win_buf_from_path(node.absolute_path) then open_file.fn("edit", node.absolute_path) elseif node then utils.focus_file(node.absolute_path)