goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.82k stars 109 forks source link

Alpha causes error when running PackerSync in a narrow window #158

Closed JulesNP closed 1 year ago

JulesNP commented 1 year ago

When using Alpha in a narrow terminal window (around 75 characters wide or less), an error occurs when trying to run :PackerSync from the main Alpha window: image

After bypassing error message by pressing enter, a second Alpha window appears, rather than the Packer window: image

Attempting to interact with or close the second Alpha window results in further error messages: image

alexdaguy commented 1 year ago

I believe you can also trigger this error by resizing the window to be very thin.

goolord commented 1 year ago

can anyone reproduce this on HEAD neovim HEAD alpha-nvim? i'm not getting this issue anymore even sporadically

bharam commented 1 year ago

This can be reproduced by splitting panes on alpha dashboard by vsp | enew or launching NvimTree when vim.fn.winwidth(0) < 80. (or opening vim in very narrow window size ~10) below is my alpha config:

local function shortcuts()
    -- snippet for setting up buffer keybindings
    return {
        {
            type = "text",
            val = {
                " New File [n]     Project [p]     Todo [t]     Settings [s]",
            },
            opts = {
                position = "center",
                hl = {
                    { "Function", 1, 19 },
                    { "Keyword", 19, 36 },
                    { "String", 36, 56 },
                    { "Number", 56, 80 },
                },
            },
        },
    }
end

local section_shortcuts = { type = "group", val = shortcuts()}

local config = {
    layout = {
        section_shortcuts,
    },
}

alpha.setup(config)
goolord commented 1 year ago

fixed in https://github.com/goolord/alpha-nvim/commit/5f19b4de786b7b083d6170963b546cf0fd50f3c7

the highlighting is still messed up a little. not sure what's up with that

goolord commented 1 year ago

fixed the highlighting in https://github.com/goolord/alpha-nvim/commit/0349fc0aa0c1d940ec3be395cb110483b416bc84

note: rn only one of the alpha windows can be active at a time, so if you :split you may notice that one of the windows will be uninteractable; this is intended but i'm working on a workaround

bharam commented 1 year ago

Thanks for the quickfix! Yeah I never split pane on alpha screen unless opening NvimTree, but just wanted to give you alternative way to reproduce. :)