enhance: respect laststatus from user
Users laststatus option is kept as is unless globalstatus option is set. closes #670
This commit is contained in:
parent
de2c4beaf5
commit
dfac736a01
|
@ -269,12 +269,16 @@ local function set_statusline()
|
||||||
if next(config.sections) ~= nil or next(config.inactive_sections) ~= nil then
|
if next(config.sections) ~= nil or next(config.inactive_sections) ~= nil then
|
||||||
vim.cmd('autocmd lualine VimResized * redrawstatus')
|
vim.cmd('autocmd lualine VimResized * redrawstatus')
|
||||||
vim.go.statusline = "%{%v:lua.require'lualine'.statusline()%}"
|
vim.go.statusline = "%{%v:lua.require'lualine'.statusline()%}"
|
||||||
vim.go.laststatus = config.options.globalstatus and 3 or 2
|
if config.options.globalstatus then
|
||||||
|
vim.go.laststatus = 3
|
||||||
|
end
|
||||||
elseif vim.go.statusline == "%{%v:lua.require'lualine'.statusline()%}" then
|
elseif vim.go.statusline == "%{%v:lua.require'lualine'.statusline()%}" then
|
||||||
vim.go.statusline = ''
|
vim.go.statusline = ''
|
||||||
|
if config.options.globalstatus then
|
||||||
vim.go.laststatus = 2
|
vim.go.laststatus = 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- lualine.statusline function
|
-- lualine.statusline function
|
||||||
--- Draw correct statusline for current window
|
--- Draw correct statusline for current window
|
||||||
|
|
Loading…
Reference in New Issue