goolord/alpha-nvim

Empty button is allowed, but it throws error

Zeioth opened this issue ยท 3 comments

Zeioth commented

I'm trying to create an emply button row like this

 dashboard.section.buttons.val = {
     dashboard.button( "n", "๐Ÿ“„  New     " , ':ene <BAR> startinsert <CR>'),
     dashboard.button( "e", "๐Ÿชฟ  Recent  " , ':Telescope oldfiles<CR>'),
     dashboard.button( "r", "๐Ÿ  Ranger  " , ':Ranger<CR>'),
     dashboard.button( "s", "๐Ÿ”Ž  Sessions" , 'SessionManager! load_session<CR>'),
     dashboard.button( "p", "๐Ÿ’ผ  Projects" , ':Telescope projects<CR>'),
     dashboard.button( "  ", " " , ' '), -- < ----This one
     dashboard.button( "q", "quit"         , ':exit<CR>'),
     --  --button("LDR f '", "๏€ฎ  Bookmarks  "),
 }

You can see the result is the expected. It leaves an emply line with no action.
screenshot_2023-05-22_00-32-22_245613975

The problem is this provokes an error in alpha.
screenshot_2023-05-22_00-34-37_957827745

yeah i have pretty much no interest in fixing this. it's an interpreted & dynamically typed language, adding robust error checking would not only pollute the code but also come at a runtime cost. doing something bad and seeing an error message is good enough

you don't need a button, you can just use a padding element or something

Zeioth commented

It worked fine without errors using 2 arguments instead of 3 thank you.

      dashboard.section.buttons.val = {
        dashboard.button("n", "๐Ÿ“„ New     ", ':ene<CR>'),
        dashboard.button("e", "๐ŸŒบ Recent  ", ':Telescope oldfiles<CR>'),
        dashboard.button("r", "๐Ÿ Ranger  ", ':Ranger<CR>'),
        dashboard.button("s", "๐Ÿ”Ž Sessions", 'SessionManager! load_session<CR>'),
        dashboard.button("p", "๐Ÿ’ผ Projects", ':Telescope projects<CR>'),
        dashboard.button("", ""),   -- <---- 2 arguments instead of 3
        dashboard.button("q", "   Quit", ':exit<CR>'),
      }