@@ -4,9 +4,8 @@ A statusline / bufferline for Neovim written in Lua. It is inspired by
|
||||
[vim-airline](https://github.com/vim-airline/vim-airline) but aims to
|
||||
be as light and simple as possible.
|
||||
|
||||
_**Note**: this plugin is mainly for my own use. I won't add new
|
||||
features/parts/themes if I don't need them. Feel free to submit PRs or fork the
|
||||
plugin though._
|
||||
_**Note**: I won't add new features/parts/themes if I don't need them. Feel free
|
||||
to submit PRs or fork the plugin though._
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
local lsp = vim.lsp
|
||||
local diagnostic, fn, lsp = vim.diagnostic, vim.fn, vim.lsp
|
||||
local fmt = string.format
|
||||
|
||||
local function get_diagnostic(prefix, severity)
|
||||
local count = lsp.diagnostic.get_count(0, severity)
|
||||
local count
|
||||
if fn.has('nvim-0.6') == 0 then
|
||||
count = lsp.diagnostic.get_count(0, severity)
|
||||
else
|
||||
local severities = {
|
||||
['Warning'] = diagnostic.severity.WARNING,
|
||||
['Error'] = diagnostic.severity.ERROR,
|
||||
}
|
||||
count = #diagnostic.get(0, {severity=severities[severity]})
|
||||
end
|
||||
if count < 1 then
|
||||
return ''
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user