nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
5.71k stars 455 forks source link

Use vim.diagnostic.count instead of get (Feat #1239) #1268

Open oskarmeyenburg opened 4 days ago

oskarmeyenburg commented 4 days ago

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.