chore: replace deprecated vim.validate({}) form#7
Conversation
|
Thank you for the PR! I ran the test suite against it, it looks like older versions of nvim are expecting the older validation syntax. Could you maybe create a polyfill (a local function) that would either call the new syntax or the old syntax based on the version of nvim? I gave you more rights to run the tests you should be able to trigger them upon PR updates. |
9e08b45 to
30ad3c4
Compare
|
Hi, I added a polyfill function that checks the version using the vim.fn.has("nvim-0.11") api and it passes the test. I don't know lua well, and I'd like your advice if perhaps something like: Would be better as the plugin will check version only once (supposedly) instead on every call? |
|
It would be better, however, since the If you want to do that improvement go ahead! Else I'm ok to merge that PR as is. |
50ee449 to
a85eff4
Compare
|
done |
The table form of vim.validate is deprecated since Neovim 0.11 and will be removed in 1.0 We add a polyfill to ensure backward compatibility with Neovim versions prior to 0.11.
Hello,
:checkhealth raises warning due to the old form of vim.validate. See https://neovim.io/doc/user/lua/#vim.validate() for details.
I changed the form to the recommended one.
Seems to work fine.