Replies: 1 comment
-
It's Try this: local node = api.tree.get_node_under_cursor()
print(vim.inspect(node.parent, { depth = 3 })) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm kind of new to nvim-tree and nvim in general, so perhaps this is a stupid question.
Is it possible to get the parent of a given node via API? I can get the "current" node (the one under the cursor) via api.tree.get_node_under_cursor(), but I would like to get the parent of that node. How can I achieve this?
Maybe the "node" object has some atribute storing the parent node? (Assuming Lua object-oriented; I'm really not sure)
Thanks
Beta Was this translation helpful? Give feedback.
All reactions