Closed jedrzejboczar closed 6 months ago
why not just set opts.callback = rhs
? i'm kinda wary about overloading neovim api
i would have used vim.keymap
but it wasn't available when I wrote the plugin, and just using opts.callback
honestly doesn't feel that dirty to me
Ah, ok, my button() wrapper code is pretty complicated so when searching why functions do not work I didn't initially find a way to support function rhs there, so I did this change to alpha. I now changed my code to conditionally use opts.callback
so this PR is not needed. It might be useful as a convenience for users (as probably most are now used to vim.keymap.set
) but if you don't want to complicate the code then feel free to close this PR.
This is useful when generating some button actions programmatically to avoid defining new globally accesible functions.