Closed emsquid closed 1 year ago
why can't you just pass function () end
instead of nil? this seems superfluous to me
why can't you just pass
function () end
instead of nil? this seems superfluous to me
Well to be honest I don't know much about lua, I just tried to fix an error I was facing, if you can fix it better I would appreciate it. Just so you know sometimes cursor_jump_press[cursor_ix] isn't defined and it gives me an error (maybe because the cursor moves on redraw idk), you can try with theta theme, pressing two times the configuration button quickly throw an error.
@goolord This issue can be reproduced.
local dashboard = require('alpha.themes.dashboard')
local button = dashboard.button
require('alpha').setup {
layout = {
{ type = 'text', val = 'hello', opts = { position = 'center' } },
{
type = 'group',
val = { button('<leader>u', 'test', ':echo "test"<CR>') },
opts = { spacing = 0 },
},
},
}
Press <CR>
twice. It will throw an error.
i see, the bug wasn't well described so i misunderstood. anyways, this doesn't seem like a very good solution to the problem adoyle-h described
https://github.com/goolord/alpha-nvim/commit/a858e4e7b0805835e61fab2b54704450427d47c3 should fix the problem described by @adoyle-h
I added a condition to execute a press only when it isn't calling a nil value (because it could try to call a nil value for me)