You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im reviewing the code for node and tree but can figure out how to change a node highlight. I want to add a global mapping that search for the node in the tree (✅), goes to the node (✅), and adds a special highlight. I cant figure out this last part, could you please show me an example?
Thanks
The text was updated successfully, but these errors were encountered:
-- consider create a stateful decorator saves the node's pathlocalMyDefault= {}
functionMyDefault:decorator()
returnfunction(node)
ifself.selectedandself.selected==node.abs_paththenreturnnode.name, '<YourAwesomeHighlight>'endreturndecorators.default(node)
endend-- use this decorator replacing the defaulttree:setup({
draw_opts= {
decorators= {
-- ...-- decorators.default,MyDefault:decorator(),
-- ...
},
},
-- ...
})
-- setting `selected` when you find your target fileMyDefault.selected=node.abs_pathtree:force_refresh_node(node)
-- dont forget to clear `selected` when you don't need the special highlight
Hi,
Im reviewing the code for node and tree but can figure out how to change a node highlight. I want to add a global mapping that search for the node in the tree (✅), goes to the node (✅), and adds a special highlight. I cant figure out this last part, could you please show me an example?
Thanks
The text was updated successfully, but these errors were encountered: