diff --git a/doc/lualine.txt b/doc/lualine.txt index 09256e6..c052629 100644 --- a/doc/lualine.txt +++ b/doc/lualine.txt @@ -375,6 +375,9 @@ General component options These are options that control behavior -- As table it must contain the icon as first entry and can use -- color option to custom color the icon. Example: -- {'branch', icon = ''} / {'branch', icon = {'', color={fg='green'}}} + + -- icon position can also be set to the right side from table. Example: + -- {'branch', icon = {'', align='right', color={fg='green'}}} icon = nil, separator = nil, -- Determines what separator to use for the component. @@ -590,7 +593,10 @@ Component specific options These are options that are available on { 'filetype', colored = true, -- Displays filetype icon in color if set to true - icon_only = false -- Display only an icon for filetype + icon_only = false, -- Display only an icon for filetype + icon = { align = 'right' }, -- Display filetype icon on the right hand side + -- icon = {'X', align='right'} + -- Icon string ^ in table is ignored in filetype component } } } diff --git a/lua/lualine/component.lua b/lua/lualine/component.lua index a427345..ded321f 100644 --- a/lua/lualine/component.lua +++ b/lua/lualine/component.lua @@ -115,7 +115,11 @@ function M:apply_icon() if type(icon) == 'table' then icon = icon[1] end - if self.options.icon_color_highlight and type(self.options.icon) == 'table' and self.options.icon.align == 'right' then + if + self.options.icon_color_highlight + and type(self.options.icon) == 'table' + and self.options.icon.align == 'right' + then self.status = table.concat { self.status, ' ',