doc: clarify open/toggle defaults, more robust legacy argument handling

This commit is contained in:
Alexander Courtis
2023-01-30 11:49:21 +11:00
parent fb775b3353
commit 9fcd50d3e1
3 changed files with 31 additions and 20 deletions

View File

@@ -1251,24 +1251,24 @@ api.tree.open({opts}) *nvim-tree.api.tree.open()*
Open the tree, focusing it if already open.
Parameters: ~
• {opts} (table) optional parameters
• {opts} (table) optional parameters with boolean defaults
Options: ~
• {path} (string) root directory for the tree
• {current_window} (boolean) open the tree in the current window
• {path} (string) root directory for the tree
• {current_window} (boolean, false) open the tree in the current window
api.tree.toggle({opts}) *nvim-tree.api.tree.toggle()*
Open or close the tree.
Parameters: ~
• {opts} (table) optional parameters
• {opts} (table) optional parameters with boolean defaults
Options: ~
• {path} (string) root directory for the tree
• {current_window} (boolean) open the tree in the current window
• {focus} (boolean) focus the tree when opening
• {find_file} (boolean) find the current buffer
• {update_root} (boolean) see |nvim-tree.update_focused_file.update_root|
• {path} (string) root directory for the tree
• {current_window} (boolean, false) open the tree in the current window
• {focus} (boolean, true) focus the tree when opening
• {find_file} (boolean, false) find the current buffer
• {update_root} (boolean, false) see |nvim-tree.update_focused_file.update_root|
api.tree.close() *nvim-tree.api.tree.close()*
Close the tree, affecting all tabs as per |nvim-tree.tab.sync.close|