Skip to content

Commit

Permalink
Fix hide.winbar (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
ernstwi committed Jul 11, 2024
1 parent e6e33b8 commit 074f6a5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lua/dashboard/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ local function buf_local()
['filetype'] = 'dashboard',
['wrap'] = false,
['signcolumn'] = 'no',
['winbar'] = '',
}
for opt, val in pairs(opts) do
vim.opt_local[opt] = val
Expand All @@ -95,6 +94,7 @@ function db:save_user_options()
self.user_cursor_line = vim.opt.cursorline:get()
self.user_laststatus_value = vim.opt.laststatus:get()
self.user_tabline_value = vim.opt.showtabline:get()
self.user_winbar_value = vim.opt.winbar:get()
end

function db:set_ui_options(opts)
Expand All @@ -104,6 +104,9 @@ function db:set_ui_options(opts)
if opts.hide.tabline then
vim.opt.showtabline = 0
end
if opts.hide.winbar then
vim.opt.winbar = ''
end
end

function db:restore_user_options(opts)
Expand All @@ -118,6 +121,10 @@ function db:restore_user_options(opts)
if opts.hide.tabline and self.user_tabline_value then
vim.opt.showtabline = tonumber(self.user_tabline_value)
end

if opts.hide.winbar and self.user_winbar_value then
vim.opt.winbar = self.user_winbar_value
end
end

function db:cache_opts()
Expand Down

0 comments on commit 074f6a5

Please sign in to comment.