File tree 3 files changed +19
-0
lines changed
3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,17 @@ local events = require "nvim-tree.events"
2
2
local explorer = require " nvim-tree.explorer"
3
3
local live_filter = require " nvim-tree.live-filter"
4
4
local view = require " nvim-tree.view"
5
+ local log = require " nvim-tree.log"
5
6
6
7
local M = {}
7
8
8
9
TreeExplorer = nil
9
10
local first_init_done = false
10
11
11
12
function M .init (foldername )
13
+ local pn = string.format (" core init %s" , foldername )
14
+ local ps = log .profile_start (pn )
15
+
12
16
if TreeExplorer then
13
17
TreeExplorer :destroy ()
14
18
end
@@ -17,6 +21,7 @@ function M.init(foldername)
17
21
events ._dispatch_ready ()
18
22
first_init_done = true
19
23
end
24
+ log .profile_end (ps , pn )
20
25
end
21
26
22
27
function M .get_explorer ()
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ local sorters = require "nvim-tree.explorer.sorters"
5
5
local filters = require " nvim-tree.explorer.filters"
6
6
local live_filter = require " nvim-tree.live-filter"
7
7
local notify = require " nvim-tree.notify"
8
+ local log = require " nvim-tree.log"
8
9
9
10
local M = {}
10
11
@@ -61,6 +62,9 @@ function M.explore(node, status)
61
62
return
62
63
end
63
64
65
+ local pn = string.format (" explore init %s" , node .absolute_path )
66
+ local ps = log .profile_start (pn )
67
+
64
68
populate_children (handle , cwd , node , status )
65
69
66
70
local is_root = not node .parent
@@ -69,11 +73,15 @@ function M.explore(node, status)
69
73
node .group_next = child_folder_only
70
74
local ns = M .explore (child_folder_only , status )
71
75
node .nodes = ns or {}
76
+
77
+ log .profile_end (ps , pn )
72
78
return ns
73
79
end
74
80
75
81
sorters .merge_sort (node .nodes , sorters .node_comparator )
76
82
live_filter .apply_filter (node )
83
+
84
+ log .profile_end (ps , pn )
77
85
return node .nodes
78
86
end
79
87
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ local M = {}
2
2
3
3
local events = require " nvim-tree.events"
4
4
local utils = require " nvim-tree.utils"
5
+ local log = require " nvim-tree.log"
5
6
6
7
local function get_win_sep_hl ()
7
8
-- #1221 WinSeparator not present in nvim 0.6.1 and some builds of 0.7.0
@@ -231,6 +232,9 @@ function M.open(options)
231
232
return
232
233
end
233
234
235
+ local pn = string.format " view open"
236
+ local ps = log .profile_start (pn )
237
+
234
238
create_buffer ()
235
239
open_window ()
236
240
M .resize ()
@@ -240,6 +244,8 @@ function M.open(options)
240
244
vim .cmd " wincmd p"
241
245
end
242
246
events ._dispatch_on_tree_open ()
247
+
248
+ log .profile_end (ps , pn )
243
249
end
244
250
245
251
local function grow ()
You can’t perform that action at this time.
0 commit comments