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.
975
975
- focus
976
976
- reload
977
977
- change_root `(path: string)`
978
+ - change_root_to_node
978
979
- change_root_to_parent
979
980
- get_node_under_cursor
980
981
- find_file `(filename: string)`
@@ -1002,6 +1003,8 @@ exists.
1002
1003
1003
1004
- api.node: *nvim-tree.api.node*
1004
1005
- open.edit
1006
+ - open.replace_tree_buffer
1007
+ - open.no_window_picker
1005
1008
- open.vertical
1006
1009
- open.horizontal
1007
1010
- open.tab
Original file line number Diff line number Diff line change @@ -21,6 +21,13 @@ Api.tree.close = require("nvim-tree.view").close
21
21
Api .tree .focus = require (" nvim-tree" ).focus
22
22
Api .tree .reload = require (" nvim-tree.actions.reloaders.reloaders" ).reload_explorer
23
23
Api .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 )
24
31
Api .tree .change_root_to_parent = inject_node (require (" nvim-tree.actions.root.dir-up" ).fn )
25
32
Api .tree .get_node_under_cursor = require (" nvim-tree.lib" ).get_node_at_cursor
26
33
Api .tree .find_file = require (" nvim-tree.actions.finders.find-file" ).fn
@@ -74,6 +81,8 @@ local function open_preview(node)
74
81
end
75
82
76
83
Api .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" )
77
86
Api .node .open .vertical = inject_node (open_or_expand_or_dir_up " vsplit" )
78
87
Api .node .open .horizontal = inject_node (open_or_expand_or_dir_up " split" )
79
88
Api .node .open .tab = inject_node (open_or_expand_or_dir_up " tabnew" )
You can’t perform that action at this time.
0 commit comments