fix: nil error with Alpha on buffers component
This commit is contained in:
parent
904f9df637
commit
cdc574c9b0
|
@ -385,6 +385,7 @@ sections = {
|
||||||
dashboard = 'Dashboard',
|
dashboard = 'Dashboard',
|
||||||
packer = 'Packer',
|
packer = 'Packer',
|
||||||
fzf = 'FZF',
|
fzf = 'FZF',
|
||||||
|
alpha = 'Alpha'
|
||||||
}, -- shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } )
|
}, -- shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } )
|
||||||
buffers_color = {
|
buffers_color = {
|
||||||
active = nil, -- color for active buffer
|
active = nil, -- color for active buffer
|
||||||
|
|
|
@ -364,6 +364,7 @@ Component specific local options ~
|
||||||
dashboard = 'Dashboard',
|
dashboard = 'Dashboard',
|
||||||
packer = 'Packer',
|
packer = 'Packer',
|
||||||
fzf = 'FZF',
|
fzf = 'FZF',
|
||||||
|
alpha = 'Alpha'
|
||||||
}, -- shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } )
|
}, -- shows specific buffer name for that filetype ( { `filetype` = `buffer_name`, ... } )
|
||||||
buffers_color = {
|
buffers_color = {
|
||||||
active = nil, -- color for active buffer
|
active = nil, -- color for active buffer
|
||||||
|
|
|
@ -12,6 +12,7 @@ local default_options = {
|
||||||
dashboard = 'Dashboard',
|
dashboard = 'Dashboard',
|
||||||
packer = 'Packer',
|
packer = 'Packer',
|
||||||
fzf = 'FZF',
|
fzf = 'FZF',
|
||||||
|
alpha = 'Alpha',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,12 +198,16 @@ function Buffers:update_status()
|
||||||
b.current = true
|
b.current = true
|
||||||
if self.options.self.section < 'lualine_x' then
|
if self.options.self.section < 'lualine_x' then
|
||||||
b.last = true
|
b.last = true
|
||||||
buffers[#buffers].last = nil
|
if #buffers > 0 then
|
||||||
|
buffers[#buffers].last = nil
|
||||||
|
end
|
||||||
buffers[#buffers + 1] = b
|
buffers[#buffers + 1] = b
|
||||||
current = #buffers
|
current = #buffers
|
||||||
else
|
else
|
||||||
b.first = true
|
b.first = true
|
||||||
buffers[1].first = nil
|
if #buffers > 0 then
|
||||||
|
buffers[1].first = nil
|
||||||
|
end
|
||||||
table.insert(buffers, 1, b)
|
table.insert(buffers, 1, b)
|
||||||
current = 1
|
current = 1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue