lualine.nvim/lua/lualine/utils.lua

22 lines
437 B
Lua
Raw Normal View History

2020-12-30 14:48:51 +00:00
local M = { }
function M.drawSection(section, separator)
local status = {}
for _, statusFunction in pairs(section) do
2020-12-30 14:48:51 +00:00
local localstatus = statusFunction()
if #localstatus > 0 then
table.insert(status, localstatus)
2020-12-30 14:48:51 +00:00
end
end
if #status == 0 then
return ''
end
local sep = ' '
if #separator > 0 then
sep = ' ' .. separator .. ' '
2020-12-30 14:48:51 +00:00
end
return ' ' .. table.concat(status, sep) .. ' '
2020-12-30 14:48:51 +00:00
end
return M