Skip to content

Commit 3595418

Browse files
committed
chore: resolve undefined-field
1 parent d663059 commit 3595418

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lua/nvim-tree/api.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,11 @@ end)
140140
Api.tree.change_root_to_node = wrap_node(function(node)
141141
if node.name == ".." or node:is(RootNode) then
142142
actions.root.change_dir.fn("..")
143-
elseif node:is(DirectoryNode) then
144-
actions.root.change_dir.fn(node:last_group_node().absolute_path)
143+
else
144+
node = node:as(DirectoryNode)
145+
if node then
146+
actions.root.change_dir.fn(node:last_group_node().absolute_path)
147+
end
145148
end
146149
end)
147150

lua/nvim-tree/explorer/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function Explorer:create_autocmds()
9898
callback = function()
9999
appearance.setup()
100100
view.reset_winhl()
101-
self:draw()
101+
self.renderer:draw()
102102
end,
103103
})
104104

0 commit comments

Comments
 (0)