goolord / alpha-nvim

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

Having no buttons in layout throws `Expected lua table` exception #119

Closed midrare closed 2 years ago

midrare commented 2 years ago

If the layout has no buttons in it, alpha.nvim will throw the following exception: screen.

Steps to reproduce

  1. Make sure layout has no buttons in it. (It doesn't need to be completely empty. It just needs to have no buttons.)
    -- example layout
    require("alpha").setup {
        layout = {},
    }
  2. Start alpha.nvim, either by starting a new instance of Neovim or calling :Alpha
  3. Observe that an exception is thrown.
goolord commented 2 years ago

do you have a use case for a theme with no buttons??? willing to support it but i'm just curious. the only reason i left this unimplemented is because i wasn't sure where to place the cursor in the event there's nothing for the user to interact with, and maybe the check wastes cpu cycles most of the time

midrare commented 2 years ago

My use case is a theme that actually does have buttons, but they're all buttons for recently-used files and recently-used sessions. On a fresh install of Neovim, there are no files or sessions in the history, so there are no buttons to show.

goolord commented 2 years ago

ok, buttonless layouts supported at 09e5374465810d71c33e9b097214adcdebeee49a

it's a relatively small change and there was no negative impact on startup time