chore: resolve undefined-field

This commit is contained in:
Alexander Courtis
2024-10-26 15:09:32 +11:00
parent d663059c3e
commit 3595418a8d
2 changed files with 6 additions and 3 deletions

View File

@@ -140,9 +140,12 @@ end)
Api.tree.change_root_to_node = wrap_node(function(node) Api.tree.change_root_to_node = wrap_node(function(node)
if node.name == ".." or node:is(RootNode) then if node.name == ".." or node:is(RootNode) then
actions.root.change_dir.fn("..") actions.root.change_dir.fn("..")
elseif node:is(DirectoryNode) then else
node = node:as(DirectoryNode)
if node then
actions.root.change_dir.fn(node:last_group_node().absolute_path) actions.root.change_dir.fn(node:last_group_node().absolute_path)
end end
end
end) end)
Api.tree.change_root_to_parent = wrap_node(actions.root.dir_up.fn) Api.tree.change_root_to_parent = wrap_node(actions.root.dir_up.fn)

View File

@@ -98,7 +98,7 @@ function Explorer:create_autocmds()
callback = function() callback = function()
appearance.setup() appearance.setup()
view.reset_winhl() view.reset_winhl()
self:draw() self.renderer:draw()
end, end,
}) })