diff options
| author | LostNeophyte <[email protected]> | 2022-12-12 15:06:02 +0100 | 
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-12 15:06:02 +0100 | 
| commit | f02b0585a8f8dee12f98f6a460ee7ef14d5864f1 (patch) | |
| tree | 4f61b29514090e7b775ee734a0b619c9a6286de7 /lua/lvim/core/theme.lua | |
| parent | d3ade21d85084634517848a7fd3582bbf2d6c278 (diff) | |
fix: only call theme's setup if it's selected (#3586)
Diffstat (limited to 'lua/lvim/core/theme.lua')
| -rw-r--r-- | lua/lvim/core/theme.lua | 15 | 
1 files changed, 9 insertions, 6 deletions
| diff --git a/lua/lvim/core/theme.lua b/lua/lvim/core/theme.lua index 2b06363b..6bf67906 100644 --- a/lua/lvim/core/theme.lua +++ b/lua/lvim/core/theme.lua @@ -64,13 +64,16 @@ M.setup = function()    end    local selected_theme = lvim.builtin.theme.name -  local status_ok, plugin = pcall(require, selected_theme) -  if not status_ok then -    return + +  if vim.startswith(lvim.colorscheme, selected_theme) then +    local status_ok, plugin = pcall(require, selected_theme) +    if not status_ok then +      return +    end +    pcall(function() +      plugin.setup(lvim.builtin.theme[selected_theme].options) +    end)    end -  pcall(function() -    plugin.setup(lvim.builtin.theme[selected_theme].options) -  end)    -- ref: https://github.com/neovim/neovim/issues/18201#issuecomment-1104754564    local colors = vim.api.nvim_get_runtime_file(("colors/%s.*"):format(lvim.colorscheme), false) | 
