diff --git a/lua/nvim-web-devicons.lua b/lua/nvim-web-devicons.lua index 7c77ba6c..44cbc7ec 100644 --- a/lua/nvim-web-devicons.lua +++ b/lua/nvim-web-devicons.lua @@ -43,7 +43,7 @@ local global_opts = { variant = nil, } --- Set the current icons tables, depending on the 'background' option. +-- Set the current icons tables, depending on variant option, then &background local function refresh_icons() local theme if global_opts.variant == "light" then @@ -381,10 +381,10 @@ function M.setup(opts) if user_icons.variant == "light" or user_icons.variant == "dark" then global_opts.variant = user_icons.variant - end - -- Load the icons after setting variant option - refresh_icons() + -- Reload the icons after setting variant option + refresh_icons() + end if user_icons.override and user_icons.override.default_icon then default_icon = user_icons.override.default_icon @@ -593,6 +593,9 @@ function M.set_default_icon(icon, color, cterm_color) set_up_highlight(default_icon) end +-- Load the icons already, the loaded tables depend on the 'background' setting. +refresh_icons() + function M.refresh() refresh_icons() M.set_up_highlights(true)