diff --git a/README.md b/README.md index 4e39c19..dd9ee54 100644 --- a/README.md +++ b/README.md @@ -385,6 +385,7 @@ sections = { dashboard = 'Dashboard', packer = 'Packer', fzf = 'FZF', + alpha = 'Alpha' }, -- shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } ) buffers_color = { active = nil, -- color for active buffer diff --git a/doc/lualine.txt b/doc/lualine.txt index 5f7d3b9..cf28573 100644 --- a/doc/lualine.txt +++ b/doc/lualine.txt @@ -364,6 +364,7 @@ Component specific local options ~ dashboard = 'Dashboard', packer = 'Packer', fzf = 'FZF', + alpha = 'Alpha' }, -- shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } ) buffers_color = { active = nil, -- color for active buffer diff --git a/lua/lualine/components/buffers.lua b/lua/lualine/components/buffers.lua index 995e2d1..8bc00bc 100644 --- a/lua/lualine/components/buffers.lua +++ b/lua/lualine/components/buffers.lua @@ -12,6 +12,7 @@ local default_options = { dashboard = 'Dashboard', packer = 'Packer', fzf = 'FZF', + alpha = 'Alpha', }, } @@ -197,12 +198,16 @@ function Buffers:update_status() b.current = true if self.options.self.section < 'lualine_x' then b.last = true - buffers[#buffers].last = nil + if #buffers > 0 then + buffers[#buffers].last = nil + end buffers[#buffers + 1] = b current = #buffers else b.first = true - buffers[1].first = nil + if #buffers > 0 then + buffers[1].first = nil + end table.insert(buffers, 1, b) current = 1 end