goolord / alpha-nvim

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

button `opts` options are not optional #255

Closed GaetanLepage closed 5 months ago

GaetanLepage commented 5 months ago

The doc states that the opts options are optional for a button. However, only providing type, val and on_press causes the plugin to crash here with the following error:

Error detected while processing VimEnter Autocommands for "*":
Error executing lua callback: ...dir/pack/myNeovimPackages/start/alpha-nvim/lua/alpha.lua:365: attempt to call a nil value
stack traceback:
        ...dir/pack/myNeovimPackages/start/alpha-nvim/lua/alpha.lua:365: in function <...dir/pack/myNeovimPackages/start/alpha-nvim/lua/
alpha.lua:344>
        ...dir/pack/myNeovimPackages/start/alpha-nvim/lua/alpha.lua:389: in function 'layout'
        ...dir/pack/myNeovimPackages/start/alpha-nvim/lua/alpha.lua:630: in function 'draw'
        ...dir/pack/myNeovimPackages/start/alpha-nvim/lua/alpha.lua:724: in function 'start'
        ...dir/pack/myNeovimPackages/start/alpha-nvim/lua/alpha.lua:787: in function <...dir/pack/myNeovimPackages/start/alpha-nvim/lua/
alpha.lua:785>
Press ENTER or type command to continue

I would suggest to update the doc or to handle the absence of this value in the code.

goolord commented 5 months ago

fixed https://github.com/goolord/alpha-nvim/commit/8e7a416cfc0c1fa2e607f279053d99041587eb99

GaetanLepage commented 5 months ago

Thanks !