mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-11-17 17:16:26 +00:00
Fix colorscheme setting on first load
This commit is contained in:
parent
a1f9fdc430
commit
718dcc79e6
@ -6,7 +6,11 @@ function _G.update_colors()
|
||||
if changed or force then
|
||||
if scope == "g" and name == "colors_name" then
|
||||
-- Colorscheme is different. Use this instead of setting colors_name directly
|
||||
vim.cmd("colorscheme " .. val)
|
||||
-- Try to set the colorscheme. If not loaded, skip the error
|
||||
local status, _ = pcall(vim.cmd, "colorscheme " .. val)
|
||||
if not status then
|
||||
vim.notify("Failed to set colorscheme to " .. val .. ". Maybe it's not yet loaded")
|
||||
end
|
||||
else
|
||||
vim[scope][name] = val
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user