When you have no buttons and press the enter key, an error gets thrown. This simple check fixes it.
Example Config:
return {
'goolord/alpha-nvim',
config = function()
local alpha = require 'alpha'
local dashboard = require 'alpha.themes.dashboard'
local api = vim.api
dashboard.section.buttons.val = {}
dashboard.section.header.opts.hl = 'Include'
dashboard.section.buttons.opts.hl = 'Macro'
dashboard.section.footer.opts.hl = 'Type'
dashboard.opts.opts.noautocmd = true
alpha.setup(dashboard.opts)
end,
}
Error Thrown:
E5108: Error executing lua: ...rs/tobin/.local/share/nvim/lazy/alpha-nvim/lua/alpha.lua:40: attempt to call a nil value
stack traceback:
...rs/tobin/.local/share/nvim/lazy/alpha-nvim/lua/alpha.lua:40: in function 'press'
...rs/tobin/.local/share/nvim/lazy/alpha-nvim/lua/alpha.lua:705: in function <...rs/tobin/.local/share/nvim/lazy/alpha-nvim/lua/alpha.lua:70
5>
honestly this just feels like a waste of cpu cycles, if you really want an alpha theme with no buttons just make an empty one bound to nothing somewhere
When you have no buttons and press the enter key, an error gets thrown. This simple check fixes it.
Example Config:
Error Thrown: E5108: Error executing lua: ...rs/tobin/.local/share/nvim/lazy/alpha-nvim/lua/alpha.lua:40: attempt to call a nil value
stack traceback:
...rs/tobin/.local/share/nvim/lazy/alpha-nvim/lua/alpha.lua:40: in function 'press'
...rs/tobin/.local/share/nvim/lazy/alpha-nvim/lua/alpha.lua:705: in function <...rs/tobin/.local/share/nvim/lazy/alpha-nvim/lua/alpha.lua:70 5>