fix(view): Recreate tree buffer if deleted, and handle scenario where buffer already exists. (#307)

This commit is contained in:
Sindre T. Strøm
2021-04-16 22:32:54 +02:00
committed by GitHub
parent 48b06ed0ce
commit 4ee45d9261
3 changed files with 46 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ local events = require'nvim-tree.events'
local populate = pops.populate
local refresh_entries = pops.refresh_entries
local first_init_done = false
local window_opts = config.window_options()
local M = {}
@@ -41,7 +42,10 @@ function M.init(with_open, with_reload)
M.Tree.loaded = true
end
events._dispatch_ready()
if not first_init_done then
events._dispatch_ready()
first_init_done = true
end
end
local function get_node_at_line(line)