In NeoVim 0.10.0 vim.diagnostic.count() was added and can be used instead of vim.diagnostic.get(). I edited vim.diagnostic.get() to be a fallback, if vim.diagnostic.count() is not available. By using vim.diagnostic.count() we avoid using a loop, which should be a minimal performance improvement.
In NeoVim 0.10.0 vim.diagnostic.count() was added and can be used instead of vim.diagnostic.get(). I edited vim.diagnostic.get() to be a fallback, if vim.diagnostic.count() is not available. By using vim.diagnostic.count() we avoid using a loop, which should be a minimal performance improvement.