NTBBloodbath / galaxyline.nvim

neovim statusline plugin written in lua
MIT License
163 stars 16 forks source link

There's no more vim.diagnostic.get_count, causing neonline to error #35

Closed nc7s closed 10 months ago

nc7s commented 2 years ago

neovim 0.6.1, error message says galaxyline.nvim/lua/galaxyline/themes/neonline.lua:231: attempt to call field 'get_count' (a nil value) @Groctel pushed a "fix" commit e2294bb734449a33cdfb596d150fc67a70383c20, but the fact is get_count() is gone for good. See https://github.com/neovim/neovim/pull/16950, and as mentioned in https://github.com/neovim/neovim/pull/16950#issuecomment-1006175721, https://github.com/vim-airline/vim-airline/commit/9a3568b815b57b8552a2a552b4f616603cb20667, which moves to vim.diagnostic.get()

nc7s commented 2 years ago

A quick change like below comes out working (at least no errors).

- local count = vim.diagnostic.get_count(0, 'Warning')
+ local count = vim.tbl_count(vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }))
nc7s commented 2 years ago

See also https://github.com/Avimitin/galaxyline.nvim/commit/201e0caf3ae750210167dde6d4825a957a344eb4, https://github.com/Avimitin/galaxyline.nvim/commit/457a91ce87e0c0da9c308f40470c4d4dbf204478

Groctel commented 2 years ago

Ey! I'm going to take a much needed nap and fix it right away. Thanks for the heads up!