mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 23:37:33 +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 changed or force then
|
||||||
if scope == "g" and name == "colors_name" then
|
if scope == "g" and name == "colors_name" then
|
||||||
-- Colorscheme is different. Use this instead of setting colors_name directly
|
-- 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
|
else
|
||||||
vim[scope][name] = val
|
vim[scope][name] = val
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user