From d5ac4a8ffd5b1819586f33e490e0452bdccc7d9d Mon Sep 17 00:00:00 2001 From: hoob3rt Date: Mon, 22 Feb 2021 20:48:23 +0100 Subject: [PATCH] fix: handle separator config edge case lualine.options.component_separators='|' now behaves the same as lualine.options.component_separators={'|'} --- lua/lualine.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lua/lualine.lua b/lua/lualine.lua index 8201a28..dfa4d16 100644 --- a/lua/lualine.lua +++ b/lua/lualine.lua @@ -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 type(M.options.component_separators) == 'string' then - M.options.component_separators = {compoennt_separator, compoennt_separator} + 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 type(M.options.section_separators) == 'string' then - M.options.section_separators = {section_separator, section_separator} + 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