diff options
Diffstat (limited to 'after')
-rw-r--r-- | after/plugin/startpage.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/after/plugin/startpage.lua b/after/plugin/startpage.lua index 2f12e56..1cdc848 100644 --- a/after/plugin/startpage.lua +++ b/after/plugin/startpage.lua @@ -3,6 +3,11 @@ if not status_ok then return end +local redraw = alpha.redraw +local win = vim.api.nvim_get_current_win() +local buf = vim.api.nvim_get_current_buf() +local augroup = vim.api.nvim_create_augroup('alpha_recalc', { clear = true }) + -- buttons local function button(sc, txt, keybind) local opts = { @@ -12,6 +17,7 @@ local function button(sc, txt, keybind) width = 80, align_shortcut = "right", hl_shortcut = "Keyword", + redraw_on_resize = false, } local function on_press() local key = vim.api.nvim_replace_termcodes(keybind .. "<Ignore>", true, false, true) @@ -69,3 +75,13 @@ if R.width <= 119 then } } end + +vim.api.nvim_create_autocmd('VimResized', { + group = augroup, + buffer = buf, + callback = function() + if vim.api.nvim_get_current_win() == win then + redraw() + end + end +}) |