Closed
Description
#1629 demonstated incorrect handling of buffers named NvimTree*
on startup.
There are further cases, mostly autocommands, in which similar tests will need to be applied. Something like:
if opts.view.centralize_selection then
create_nvim_tree_autocmd("BufEnter", {
pattern = "NvimTree_*",
callback = function()
if utils.is_current_buf_nvim_tree() then
vim.schedule(function()
local keys = api.nvim_replace_termcodes("zz", true, false, true)
api.nvim_feedkeys(keys, "n", true)
end)
end
end,
})
end
It's probably safe to just test the filetype as it should be set at most of these points.