refactor(#2826): retain necessary view globals

This commit is contained in:
Alexander Courtis
2025-05-03 08:04:06 +10:00
parent 6218f9c2f6
commit e0759880db
10 changed files with 55 additions and 24 deletions

View File

@@ -56,6 +56,8 @@ function Explorer:new(args)
self.uid_explorer = vim.loop.hrtime()
self.augroup_id = vim.api.nvim_create_augroup("NvimTree_Explorer_" .. self.uid_explorer, {})
self:log_lifecycle("Explorer:new")
self.open = true
self.opts = config
@@ -73,7 +75,7 @@ function Explorer:new(args)
end
function Explorer:destroy()
log.line("dev", "Explorer:destroy")
self:log_lifecycle("Explorer:des")
vim.api.nvim_del_augroup_by_id(self.augroup_id)
@@ -587,6 +589,12 @@ function Explorer:get_nodes()
return self:clone()
end
---Log a lifecycle message with uid_explorer and absolute_path
---@param msg string?
function Explorer:log_lifecycle(msg)
log.line("lifecycle", "%-15s %d %s", msg, self.uid_explorer, self.absolute_path)
end
function Explorer:setup(opts)
config = opts
end