diff options
Diffstat (limited to 'nvim/lua/config')
| -rw-r--r-- | nvim/lua/config/statusline.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/nvim/lua/config/statusline.lua b/nvim/lua/config/statusline.lua index ef6f315..488708f 100644 --- a/nvim/lua/config/statusline.lua +++ b/nvim/lua/config/statusline.lua | |||
| @@ -78,11 +78,15 @@ end | |||
| 78 | ------------------------------------------------------------------------ | 78 | ------------------------------------------------------------------------ |
| 79 | 79 | ||
| 80 | local function diagnostics() | 80 | local function diagnostics() |
| 81 | -- count() zaehlt in einem Durchgang; get() baut pro Aufruf die komplette Liste | ||
| 82 | local severity = vim.diagnostic.severity | ||
| 83 | local by_severity = vim.diagnostic.count(0) | ||
| 84 | |||
| 81 | local counts = { | 85 | local counts = { |
| 82 | error = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR }), | 86 | error = by_severity[severity.ERROR] or 0, |
| 83 | warn = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN }), | 87 | warn = by_severity[severity.WARN] or 0, |
| 84 | info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO }), | 88 | info = by_severity[severity.INFO] or 0, |
| 85 | hint = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT }), | 89 | hint = by_severity[severity.HINT] or 0, |
| 86 | } | 90 | } |
| 87 | 91 | ||
| 88 | local parts = {} | 92 | local parts = {} |
