From 38ea991bb8a507eb636b15931a2f1c7e89a8a9d4 Mon Sep 17 00:00:00 2001 From: Squibid Date: Mon, 26 Jun 2023 11:36:34 -0400 Subject: add startpage resizing prob doesn't work, but I'm too lazy to check --- after/plugin/startpage.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'after/plugin') 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 .. "", 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 +}) -- cgit v1.2.1