add startpage resizing
prob doesn't work, but I'm too lazy to check
This commit is contained in:
parent
9e694c0372
commit
38ea991bb8
1 changed files with 16 additions and 0 deletions
|
|
@ -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
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue