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.
goolord commented
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
goolord commented
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>'),
}