From dfac736a015f1c295eae517d9af0db87413a88ac Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Thu, 28 Apr 2022 19:08:08 +0600 Subject: [PATCH] enhance: respect laststatus from user Users laststatus option is kept as is unless globalstatus option is set. closes #670 --- lua/lualine.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/lualine.lua b/lua/lualine.lua index dc849b9..717d14c 100644 --- a/lua/lualine.lua +++ b/lua/lualine.lua @@ -269,10 +269,14 @@ local function set_statusline() if next(config.sections) ~= nil or next(config.inactive_sections) ~= nil then vim.cmd('autocmd lualine VimResized * redrawstatus') 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 vim.go.statusline = '' - vim.go.laststatus = 2 + if config.options.globalstatus then + vim.go.laststatus = 2 + end end end