Fix malloc error

This commit is contained in:
Olivier Roques
2020-12-28 20:52:00 +01:00
parent 17f4213165
commit d3badaa76a
2 changed files with 4 additions and 5 deletions

View File

@@ -48,7 +48,7 @@ end
function M.update_bufferline()
local sections = {}
local buffers = bufferline.get_buffers()
local separator = {class = 'bufferline', item = '|', conceal = true}
local separator = '|'
for i, buffer in ipairs(buffers) do
table.insert(sections, bufferline.to_section(buffer))
if i < #buffers then table.insert(sections, separator) end

View File

@@ -34,10 +34,9 @@ function M.get_state(section)
end
if section.class == 'bufferline' then
if section.conceal then return 'conceal' end
local state = {}
table.insert(state, section.current and 'current' or 'background')
if section.modified then table.insert(state, 'modified') end
return table.concat(state, '_')
local state = section.current and 'current' or 'background'
if section.modified then state = string.format('%s_modified', state) end
return state
end
return M.is_active() and 'active' or 'inactive'
end