File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -975,6 +975,7 @@ exists.
975975 - focus
976976 - reload
977977 - change_root `(path: string)`
978+ - change_root_to_node
978979 - change_root_to_parent
979980 - get_node_under_cursor
980981 - find_file `(filename: string)`
@@ -1002,6 +1003,8 @@ exists.
10021003
10031004- api.node: *nvim-tree.api.node*
10041005 - open.edit
1006+ - open.replace_tree_buffer
1007+ - open.no_window_picker
10051008 - open.vertical
10061009 - open.horizontal
10071010 - open.tab
Original file line number Diff line number Diff line change @@ -21,6 +21,13 @@ Api.tree.close = require("nvim-tree.view").close
2121Api .tree .focus = require (" nvim-tree" ).focus
2222Api .tree .reload = require (" nvim-tree.actions.reloaders.reloaders" ).reload_explorer
2323Api .tree .change_root = require (" nvim-tree" ).change_dir
24+ Api .tree .change_root_to_node = inject_node (function (node )
25+ if node .name == " .." then
26+ require (" nvim-tree.actions.root.change-dir" ).fn " .."
27+ elseif node .nodes ~= nil then
28+ require (" nvim-tree.actions.root.change-dir" ).fn (require (" nvim-tree.lib" ).get_last_group_node (node ).absolute_path )
29+ end
30+ end )
2431Api .tree .change_root_to_parent = inject_node (require (" nvim-tree.actions.root.dir-up" ).fn )
2532Api .tree .get_node_under_cursor = require (" nvim-tree.lib" ).get_node_at_cursor
2633Api .tree .find_file = require (" nvim-tree.actions.finders.find-file" ).fn
@@ -74,6 +81,8 @@ local function open_preview(node)
7481end
7582
7683Api .node .open .edit = inject_node (open_or_expand_or_dir_up " edit" )
84+ Api .node .open .replace_tree_buffer = inject_node (open_or_expand_or_dir_up " edit_in_place" )
85+ Api .node .open .no_window_picker = inject_node (open_or_expand_or_dir_up " edit_no_picker" )
7786Api .node .open .vertical = inject_node (open_or_expand_or_dir_up " vsplit" )
7887Api .node .open .horizontal = inject_node (open_or_expand_or_dir_up " split" )
7988Api .node .open .tab = inject_node (open_or_expand_or_dir_up " tabnew" )
You can’t perform that action at this time.
0 commit comments