summaryrefslogtreecommitdiff
path: root/lua/lvim/core/theme.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2022-10-04 19:23:52 +0200
committerGitHub <[email protected]>2022-10-04 13:23:52 -0400
commite5bcf01c759e7c833d8a5f1fcf665b6ea32a7c16 (patch)
tree51b68c8face9faa2a41fcc8103b6296213557d4b /lua/lvim/core/theme.lua
parent560ee4d7cf4038a22a5556d79ad92cd226a792dc (diff)
refactor: more deliberate reload (#3133)
Diffstat (limited to 'lua/lvim/core/theme.lua')
-rw-r--r--lua/lvim/core/theme.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/lua/lvim/core/theme.lua b/lua/lvim/core/theme.lua
index 43ba3a07..394963a0 100644
--- a/lua/lvim/core/theme.lua
+++ b/lua/lvim/core/theme.lua
@@ -83,13 +83,23 @@ M.config = function()
end
M.setup = function()
+ -- avoid running in headless mode since it's harder to detect failures
+ if #vim.api.nvim_list_uis() == 0 then
+ local Log = require "lvim.core.log"
+ Log:debug "headless mode detected, skipping running setup for lualine"
+ return
+ end
+
local status_ok, theme = pcall(require, "tokyonight")
if not status_ok then
return
end
theme.setup(lvim.builtin.theme.options)
- lvim.builtin.lualine.options.theme = "tokyonight"
+
+ require("lvim.core.lualine").setup()
+
+ require("lvim.core.lir").icon_setup()
end
return M