File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -362,16 +362,24 @@ local function setup_autocommands(opts)
362
362
end
363
363
364
364
create_nvim_tree_autocmd (" BufReadPost" , {
365
- callback = function ()
366
- if filters .config .filter_no_buffer or renderer .config .highlight_opened_files ~= " none" then
365
+ callback = function (data )
366
+ -- update opened file buffers
367
+ if
368
+ (filters .config .filter_no_buffer or renderer .config .highlight_opened_files ~= " none" )
369
+ and vim .bo [data .buf ].buftype == " "
370
+ then
367
371
reloaders .reload_explorer ()
368
372
end
369
373
end ,
370
374
})
371
375
372
376
create_nvim_tree_autocmd (" BufUnload" , {
373
377
callback = function (data )
374
- if filters .config .filter_no_buffer or renderer .config .highlight_opened_files ~= " none" then
378
+ -- update opened file buffers
379
+ if
380
+ (filters .config .filter_no_buffer or renderer .config .highlight_opened_files ~= " none" )
381
+ and vim .bo [data .buf ].buftype == " "
382
+ then
375
383
reloaders .reload_explorer (nil , data .buf )
376
384
end
377
385
end ,
You can’t perform that action at this time.
0 commit comments