diff --git a/lua/lualine/highlight.lua b/lua/lualine/highlight.lua index 2f79601..8c31760 100644 --- a/lua/lualine/highlight.lua +++ b/lua/lualine/highlight.lua @@ -10,7 +10,22 @@ local function highlight (name, foreground, background, special) return table.concat(command, ' ') end +local function apply_defaults_to_theme(theme) + local modes = {'insert', 'visual', 'replace', 'command', 'terminal', 'inactive'} + for _, mode in ipairs(modes) do + if not theme[mode] then + theme[mode] = theme['normal'] + else + for section_name, section in pairs(theme['normal']) do + theme[mode][section_name] = (theme[mode][section_name] or section) + end + end + end + return theme +end + function M.create_highlight_groups(theme) + apply_defaults_to_theme(theme) for mode, sections in pairs(theme) do for section, colorscheme in pairs(sections) do local special = nil