refactor: removed ability to set theme in runtime (#130)
This commit is contained in:
parent
6e64822f50
commit
3e0332e6d2
|
@ -7,8 +7,6 @@ local highlight = require('lualine.highlight')
|
||||||
|
|
||||||
local M = { }
|
local M = { }
|
||||||
|
|
||||||
local theme_set = {}
|
|
||||||
|
|
||||||
M.options = {
|
M.options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
theme = 'gruvbox',
|
theme = 'gruvbox',
|
||||||
|
@ -16,7 +14,6 @@ M.options = {
|
||||||
section_separators = {'', ''},
|
section_separators = {'', ''},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
M.sections = {
|
M.sections = {
|
||||||
lualine_a = { 'mode' },
|
lualine_a = { 'mode' },
|
||||||
lualine_b = { 'branch' },
|
lualine_b = { 'branch' },
|
||||||
|
@ -201,14 +198,10 @@ local function lualine_set_theme()
|
||||||
end
|
end
|
||||||
utils.clear_highlights()
|
utils.clear_highlights()
|
||||||
highlight.create_highlight_groups(M.options.theme)
|
highlight.create_highlight_groups(M.options.theme)
|
||||||
theme_set = M.options.theme
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local function statusline(sections, is_focused)
|
local function statusline(sections, is_focused)
|
||||||
if M.options.theme ~= theme_set then
|
|
||||||
_G.lualine_set_theme()
|
|
||||||
end
|
|
||||||
local function create_status_builder()
|
local function create_status_builder()
|
||||||
-- The sequence sections should maintain
|
-- The sequence sections should maintain
|
||||||
local section_sequence = {'a', 'b', 'c', 'x', 'y', 'z'}
|
local section_sequence = {'a', 'b', 'c', 'x', 'y', 'z'}
|
||||||
|
|
Loading…
Reference in New Issue