fix data race with setting up web-devicon on start..

This commit is contained in:
kiyan42 2020-11-01 14:50:10 +01:00
parent d57bf4a25d
commit 253341a731
2 changed files with 8 additions and 3 deletions

View File

@ -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
}

View File

@ -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