fix data race with setting up web-devicon on start..
This commit is contained in:
parent
d57bf4a25d
commit
253341a731
@ -62,8 +62,13 @@ local function get_links()
|
||||
}
|
||||
end
|
||||
|
||||
local opts = nil
|
||||
|
||||
return {
|
||||
configure = function(opts)
|
||||
configure = function(o)
|
||||
opts = o
|
||||
end,
|
||||
setup = function()
|
||||
if opts and opts.web_devicons.show == true then
|
||||
if not require'nvim-web-devicons'.has_loaded() then
|
||||
require'nvim-web-devicons'.setup({ default = opts.web_devicons.default })
|
||||
@ -80,7 +85,5 @@ return {
|
||||
for k, d in pairs(links) do
|
||||
vim.cmd('hi def link NvimTree'..k..' '..d)
|
||||
end
|
||||
|
||||
vim.cmd "au! Colorscheme * lua require'nvim-tree.colors'.configure()"
|
||||
end
|
||||
}
|
||||
|
||||
@ -97,6 +97,8 @@ function M.setup(opts)
|
||||
vim.cmd "command! NvimTreeClipboard lua require'nvim-tree'.print_clipboard()"
|
||||
vim.cmd "command! NvimTreeFindFile lua require'nvim-tree'.find_file(true)"
|
||||
|
||||
vim.cmd "au! Colorscheme * lua require'nvim-tree.colors'.setup()"
|
||||
|
||||
if M.config.tab_open then
|
||||
vim.cmd "au TabEnter * lua require'nvim-tree'.redraw()"
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user