File tree 4 files changed +5
-10
lines changed
4 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -250,9 +250,9 @@ via |nvim-tree.on_attach| e.g. >
250
250
251
251
Open the tree if it is closed, and then focus on the tree.
252
252
253
- See | nvim-tree-api.tree.focus () |
253
+ See | nvim-tree-api.tree.open () |
254
254
255
- Calls: `api.tree.focus ()`
255
+ Calls: `api.tree.open ()`
256
256
257
257
*:NvimTreeRefresh*
258
258
@@ -1587,6 +1587,7 @@ tree.close_in_all_tabs() *nvim-tree-api.tree.close_in_all_tabs()*
1587
1587
1588
1588
tree.focus() *nvim-tree-api.tree.focus()*
1589
1589
Focus the tree, opening it if necessary.
1590
+ Retained for compatibility, use | tree.open() | with no arguments instead.
1590
1591
1591
1592
tree.reload() *nvim-tree-api.tree.reload()*
1592
1593
Refresh the tree. Does nothing if closed.
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ local git = require "nvim-tree.git"
13
13
local filters = require " nvim-tree.explorer.filters"
14
14
local modified = require " nvim-tree.modified"
15
15
local find_file = require " nvim-tree.actions.tree.find-file"
16
- local open = require " nvim-tree.actions.tree.open"
17
16
local events = require " nvim-tree.events"
18
17
local notify = require " nvim-tree.notify"
19
18
@@ -23,11 +22,6 @@ local M = {
23
22
init_root = " " ,
24
23
}
25
24
26
- function M .focus ()
27
- open .fn ()
28
- view .focus ()
29
- end
30
-
31
25
--- Update the tree root to a directory or the directory containing
32
26
--- @param path string relative or absolute
33
27
--- @param bufnr number | nil
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ Api.tree.close_in_this_tab = wrap(require("nvim-tree.view").close_this_tab_only)
86
86
Api .tree .close_in_all_tabs = wrap (require (" nvim-tree.view" ).close_all_tabs )
87
87
88
88
Api .tree .focus = wrap (function ()
89
- require ( " nvim- tree" ). focus ()
89
+ Api . tree . open ()
90
90
end )
91
91
92
92
Api .tree .reload = wrap (require (" nvim-tree.actions.reloaders.reloaders" ).reload_explorer )
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ local CMDS = {
48
48
bar = true ,
49
49
},
50
50
command = function ()
51
- api .tree .focus ()
51
+ api .tree .open ()
52
52
end ,
53
53
},
54
54
{
You can’t perform that action at this time.
0 commit comments