fix(#549): add more profiling ~tree init

This commit is contained in:
Alexander Courtis
2022-12-16 12:12:06 +11:00
parent 899ed45602
commit 95ed588211
3 changed files with 19 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ local events = require "nvim-tree.events"
local explorer = require "nvim-tree.explorer"
local live_filter = require "nvim-tree.live-filter"
local view = require "nvim-tree.view"
local log = require "nvim-tree.log"
local M = {}
@@ -9,6 +10,9 @@ TreeExplorer = nil
local first_init_done = false
function M.init(foldername)
local pn = string.format("core init %s", foldername)
local ps = log.profile_start(pn)
if TreeExplorer then
TreeExplorer:destroy()
end
@@ -17,6 +21,7 @@ function M.init(foldername)
events._dispatch_ready()
first_init_done = true
end
log.profile_end(ps, pn)
end
function M.get_explorer()