fix(alpha): check height of the aplha window (#3585)

This commit is contained in:
LostNeophyte 2022-12-12 15:11:28 +01:00 committed by GitHub
parent f02b0585a8
commit 3166cc00b0
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,13 +24,13 @@ local banner = {
}
M.banner_small = {
"⠀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⣰⣶ ⠀⠀⢀⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀",
"⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⣀⡀⠀⠀⠀⣰⣿⠏⠀⠀ ⠘⠿⠟ ",
"⠀⠀⣿⡟⠀⠀⠀⠀⠀⠀⣤⡄⠀⠀⠀⣠⣤⠀⠀⢠⣤⣀⣤⣤⣤⡀⠀⠀⠀⢀⣤⣤⣤⣤⡀⠀⠀⠀⢠⣤⢀⣤⣤⣄⠀⠀⣿⣿⠀ ⢰⣿⠏ ⣶⣶⣶⣶⡦⠀⠀⠀⢠⣶⣦⣴⣦⣠⣴⣦⡀⠀",
"⠀⢠⣿⡇⠀⠀⠀⠀⠀⢠⣿⠇⠀⠀⠀⣿⡇⠀⠀⣿⡿⠉⠀⠈⣿⣧⠀⠀⠰⠿⠋⠀⠀⢹⣿⠀⠀⠀⣿⡿⠋⠀⠹⠿⠀⠀⢻⣿⡇⢠⣿⡟⠀⠀⠀⠈⠉⢹⣿⡇⠀⠀⠀⢸⣿⡏⢹⣿⡏⢹⣿⡇⠀",
"⠀⢸⣿⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⠀⢰⣿⠃⠀⢠⣿⡇⠀⠀⠀⣿⡇⠀⠀⣠⣴⡶⠶⠶⣿⣿⠀⠀⢠⣿⡇⠀⠀⠀⠀⠀⠀⢸⣿⣇⣿⡿⠀⠀⠀⠀⠀⠀⣿⣿⠁⠀⠀⠀⣿⣿⠀⣾⣿⠀⣾⣿⠁⠀",
"⠀⣿⣟⠀⠀⠀⠀⠀⠀⢻⣿⡀⠀⢀⣼⣿⠀⠀⢸⣿⠀⠀⠀⢰⣿⠇⠀⢰⣿⣇⠀⠀⣠⣿⡏⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⠁⠀⠀⠀⣀⣀⣠⣿⣿⣀⡀⠀⢠⣿⡟⢠⣿⡟⢀⣿⡿⠀⠀",
"⠀⠛⠛⠛⠛⠛⠛⠁⠀⠈⠛⠿⠟⠋⠛⠃⠀⠀⠛⠛⠀⠀⠀⠘⠛⠀⠀⠀⠙⠿⠿⠛⠙⠛⠃⠀⠀⠚⠛⠀⠀⠀⠀⠀⠀⠀⠘⠿⠿⠃⠀⠀⠀⠀⠿⠿⠿⠿⠿⠿⠿⠀⠸⠿⠇⠸⠿⠇⠸⠿⠇⠀⠀",
" ⢀⣀ ⣰⣶ ⢀⣤⣄ ",
" ⢸⣿ ⣀⡀ ⣰⣿⠏ ⠘⠿⠟ ",
" ⣿⡟ ⣤⡄ ⣠⣤ ⢠⣤⣀⣤⣤⣤⡀ ⢀⣤⣤⣤⣤⡀ ⢠⣤⢀⣤⣤⣄ ⣿⣿ ⢰⣿⠏ ⣶⣶⣶⣶⡦ ⢠⣶⣦⣴⣦⣠⣴⣦⡀ ",
" ⢠⣿⡇ ⢠⣿⠇ ⣿⡇ ⣿⡿⠉ ⠈⣿⣧ ⠰⠿⠋ ⢹⣿ ⣿⡿⠋ ⠹⠿ ⢻⣿⡇⢠⣿⡟ ⠈⠉⢹⣿⡇ ⢸⣿⡏⢹⣿⡏⢹⣿⡇ ",
" ⢸⣿ ⢸⣿ ⢰⣿⠃ ⢠⣿⡇ ⣿⡇ ⣠⣴⡶⠶⠶⣿⣿ ⢠⣿⡇ ⢸⣿⣇⣿⡿ ⣿⣿⠁ ⣿⣿ ⣾⣿ ⣾⣿⠁ ",
" ⣿⣟ ⢻⣿⡀ ⢀⣼⣿ ⢸⣿ ⢰⣿⠇ ⢰⣿⣇ ⣠⣿⡏ ⢸⣿ ⢸⣿⣿⣿⠁ ⣀⣀⣠⣿⣿⣀⡀ ⢠⣿⡟⢠⣿⡟⢀⣿⡿ ",
" ⠛⠛⠛⠛⠛⠛⠁ ⠈⠛⠿⠟⠋⠛⠃ ⠛⠛ ⠘⠛ ⠙⠿⠿⠛⠙⠛⠃ ⠚⠛ ⠘⠿⠿⠃ ⠿⠿⠿⠿⠿⠿⠿ ⠸⠿⠇⠸⠿⠇⠸⠿⠇ ",
}
M.banner_alt_1 = {
@ -87,7 +87,12 @@ function M.get_sections()
local header = {
type = "text",
val = function()
if vim.api.nvim_win_get_height(0) < 36 then
local alpha_wins = vim.tbl_filter(function(win)
local buf = vim.api.nvim_win_get_buf(win)
return vim.api.nvim_buf_get_option(buf, "filetype") == "alpha"
end, vim.api.nvim_list_wins())
if vim.api.nvim_win_get_height(alpha_wins[#alpha_wins]) < 36 then
return M.banner_small
end
return banner