diff --git a/doc/lualine.txt b/doc/lualine.txt index 1f6e82f..c781303 100644 --- a/doc/lualine.txt +++ b/doc/lualine.txt @@ -521,6 +521,9 @@ Component specific options These are options that are available on alpha = 'Alpha' }, -- Shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } ) + -- Automatically updates active buffer color to match color of other components (will be overidden if buffers_color is set) + use_mode_colors = false, + buffers_color = { -- Same values as the general color option can be used here. active = 'lualine_{section}_normal', -- Color for active buffer. @@ -691,6 +694,9 @@ Component specific options These are options that are available on -- 1: Shows tab_name -- 2: Shows tab_nr + tab_name + -- Automatically updates active tab color to match color of other components (will be overidden if buffers_color is set) + use_mode_colors = false, + tabs_color = { -- Same values as the general color option can be used here. active = 'lualine_{section}_normal', -- Color for active tab. @@ -739,6 +745,9 @@ Component specific options These are options that are available on disabled_buftypes = { 'quickfix', 'prompt' }, -- Hide a window if its buffer's type is disabled + -- Automatically updates active window color to match color of other components (will be overidden if buffers_color is set) + use_mode_colors = false, + windows_color = { -- Same values as the general color option can be used here. active = 'lualine_{section}_normal', -- Color for active window. diff --git a/lua/lualine/components/buffers/init.lua b/lua/lualine/components/buffers/init.lua index 880f2a8..af45661 100644 --- a/lua/lualine/components/buffers/init.lua +++ b/lua/lualine/components/buffers/init.lua @@ -51,9 +51,11 @@ end function M:init(options) M.super.init(self, options) -- if use_mode_colors is set, use a function so that the colors update - local default_active = options.use_mode_colors and - function() return get_hl('lualine_' .. options.self.section, true) end - or get_hl('lualine_' .. options.self.section, true) + local default_active = options.use_mode_colors + and function() + return get_hl('lualine_' .. options.self.section, true) + end + or get_hl('lualine_' .. options.self.section, true) default_options.buffers_color = { active = default_active, inactive = get_hl('lualine_' .. options.self.section, false), diff --git a/lua/lualine/components/tabs/init.lua b/lua/lualine/components/tabs/init.lua index e25c179..b176b45 100644 --- a/lua/lualine/components/tabs/init.lua +++ b/lua/lualine/components/tabs/init.lua @@ -36,9 +36,11 @@ end function M:init(options) M.super.init(self, options) -- if use_mode_colors is set, use a function so that the colors update - local default_active = options.use_mode_colors and - function() return get_hl('lualine_' .. options.self.section, true) end - or get_hl('lualine_' .. options.self.section, true) + local default_active = options.use_mode_colors + and function() + return get_hl('lualine_' .. options.self.section, true) + end + or get_hl('lualine_' .. options.self.section, true) default_options.tabs_color = { active = default_active, inactive = get_hl('lualine_' .. options.self.section, false),