Getting errors trying to call get_node_at_cursor
#3003
-
DescriptionI updated nvim-tree the other day and now get errors when trying to call Now I noticed this was moved to the Thanks! Neovim version
Operating system and versionmacOS 15.0.1 nvim-tree versionnvim-tree-v1.8.0 - commit c763948 Clean room replicationPut this anywhere in your vim config: autocmd('CursorMoved', {
pattern = 'NvimTree*',
callback = function()
print('NvimTree: ' .. require('nvim-tree.explorer').get_node_at_cursor().name)
end
}) Steps to reproduce
Expected behaviorThe tree opens without errors and when moving around it prints the full name of the node. Actual behaviorIt throws these errors:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Sorry, those are internal APIs and will change. Please use the public API Moving to discussion, please let me know if you have any further issues. |
Beta Was this translation helpful? Give feedback.
-
OK, I now updated it to this which fixes the issue 👍🏻 autocmd('CursorMoved', {
pattern = 'NvimTree*',
callback = function()
print('NvimTree: ' .. require('nvim-tree-api').tree.get_node_under_cursor().name)
end
}) |
Beta Was this translation helpful? Give feedback.
Sorry, those are internal APIs and will change.
Please use the public API
:help nvim-tree-api.tree.get_node_under_cursor()
Moving to discussion, please let me know if you have any further issues.