summaryrefslogtreecommitdiff
path: root/lua/lvim/core/lualine
diff options
context:
space:
mode:
Diffstat (limited to 'lua/lvim/core/lualine')
-rw-r--r--lua/lvim/core/lualine/init.lua8
-rw-r--r--lua/lvim/core/lualine/styles.lua13
-rw-r--r--lua/lvim/core/lualine/utils.lua13
3 files changed, 15 insertions, 19 deletions
diff --git a/lua/lvim/core/lualine/init.lua b/lua/lvim/core/lualine/init.lua
index c8eca23f..e041e8a8 100644
--- a/lua/lvim/core/lualine/init.lua
+++ b/lua/lvim/core/lualine/init.lua
@@ -34,8 +34,14 @@ 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
+
require("lvim.core.lualine.styles").update()
- require("lvim.core.lualine.utils").validate_theme()
local lualine = require "lualine"
lualine.setup(lvim.builtin.lualine)
diff --git a/lua/lvim/core/lualine/styles.lua b/lua/lvim/core/lualine/styles.lua
index f5f5871a..45c6c639 100644
--- a/lua/lvim/core/lualine/styles.lua
+++ b/lua/lvim/core/lualine/styles.lua
@@ -10,6 +10,7 @@ local styles = {
styles.none = {
style = "none",
options = {
+ theme = "auto",
icons_enabled = true,
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
@@ -38,6 +39,7 @@ styles.none = {
styles.default = {
style = "default",
options = {
+ theme = "auto",
icons_enabled = true,
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
@@ -66,10 +68,11 @@ styles.default = {
styles.lvim = {
style = "lvim",
options = {
+ theme = "auto",
icons_enabled = true,
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
- disabled_filetypes = { "dashboard", "NvimTree", "Outline" },
+ disabled_filetypes = { "alpha", "NvimTree", "Outline" },
},
sections = {
lualine_a = {
@@ -113,10 +116,10 @@ function M.get_style(style)
if not vim.tbl_contains(style_keys, style) then
local Log = require "lvim.core.log"
Log:error(
- "Invalid lualine style",
- string.format('"%s"', style),
- "options are: ",
- string.format('"%s"', table.concat(style_keys, '", "'))
+ "Invalid lualine style"
+ .. string.format('"%s"', style)
+ .. "options are: "
+ .. string.format('"%s"', table.concat(style_keys, '", "'))
)
Log:debug '"lvim" style is applied.'
style = "lvim"
diff --git a/lua/lvim/core/lualine/utils.lua b/lua/lvim/core/lualine/utils.lua
index d685e044..3fd3c2d3 100644
--- a/lua/lvim/core/lualine/utils.lua
+++ b/lua/lvim/core/lualine/utils.lua
@@ -1,18 +1,5 @@
local M = {}
-function M.validate_theme()
- local theme = lvim.builtin.lualine.options.theme or "auto"
- if type(theme) == "table" then
- return
- end
-
- local lualine_loader = require "lualine.utils.loader"
- local ok = pcall(lualine_loader.load_theme, theme)
- if not ok then
- lvim.builtin.lualine.options.theme = "auto"
- end
-end
-
function M.env_cleanup(venv)
if string.find(venv, "/") then
local final_venv = venv