How to get the status of a directory node? #3013
-
I want to check if the directory is opened or collapse? Something like this: local node = api.tree.get_node_under_cursor()
if node == nil then
return
end
if vim.fn.isdirectory(node.absolute_path) == 1 then
if node is not opened then
api.node.navigate.parent(node)
else
api.node.open.edit(node)
end
end How do I implement this? |
Beta Was this translation helpful? Give feedback.
Answered by
Kaiser-Yang
Nov 27, 2024
Replies: 1 comment
-
Just use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kaiser-Yang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just use
node.open
.