Buffer separator option

This commit is contained in:
Alessandro Morelli
2021-07-07 01:03:05 +02:00
committed by Olivier Roques
parent 2e5279b1aa
commit 8b6d209262

View File

@@ -16,7 +16,7 @@ M.options = {
bufferline_settings = {
exclude_terminal = false,
show_index = false,
separator = true,
separator = '|',
},
theme = 'default',
sections = {
@@ -168,14 +168,10 @@ function M.update_bufferline()
local sections = {}
local settings = M.options.bufferline_settings
local buffers = bufferline.get_buffers(settings)
local separator = ''
if M.options.bufferline_settings.separator then
separator = '|'
end
for i, buffer in ipairs(buffers) do
table.insert(sections, bufferline.to_section(buffer, i, settings))
if i < #buffers then
table.insert(sections, separator)
table.insert(sections, M.options.bufferline_settings.separator)
end
end
return table.concat(highlight_sections(sections))