fix: handle separator config edge case

lualine.options.component_separators='|' now behaves the same as lualine.options.component_separators={'|'}
This commit is contained in:
hoob3rt 2021-02-22 20:48:23 +01:00
parent 7115aa8f8b
commit d5ac4a8ffd
1 changed files with 12 additions and 4 deletions

View File

@ -41,11 +41,19 @@ M.extensions = {
local function check_single_separator()
local compoennt_separator = M.options.component_separators
local section_separator = M.options.section_separators
if M.options.component_separators ~=nil then
if type(M.options.component_separators) == 'string' then
M.options.component_separators = {compoennt_separator, compoennt_separator}
elseif #M.options.component_separators == 1 then
M.options.component_separators = {M.options.component_separators[1], M.options.component_separators[1]}
end
end
if M.options.section_separators ~=nil then
if type(M.options.section_separators) == 'string' then
M.options.section_separators = {section_separator, section_separator}
elseif #M.options.section_separators == 1 then
M.options.section_separators = {M.options.section_separators[1], M.options.section_separators[1]}
end
end
end