fix feline with new diagnostic api

This commit is contained in:
boppyt 2021-12-23 01:23:46 +09:00 committed by siduck
parent 3a966955d4
commit dbc95e41bf
1 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,6 @@
local colors = require("colors").get() local colors = require("colors").get()
local lsp = require "feline.providers.lsp" local lsp = require "feline.providers.lsp"
local lsp_severity = vim.diagnostic.severity
local icon_styles = { local icon_styles = {
default = { default = {
@ -150,7 +151,7 @@ components.active[1][6] = {
components.active[1][7] = { components.active[1][7] = {
provider = "diagnostic_errors", provider = "diagnostic_errors",
enabled = function() enabled = function()
return lsp.diagnostics_exist "Error" return lsp.diagnostics_exist(lsp_severity.ERROR)
end, end,
hl = { fg = colors.red }, hl = { fg = colors.red },
@ -160,7 +161,7 @@ components.active[1][7] = {
components.active[1][8] = { components.active[1][8] = {
provider = "diagnostic_warnings", provider = "diagnostic_warnings",
enabled = function() enabled = function()
return lsp.diagnostics_exist "Warning" return lsp.diagnostics_exist(lsp_severity.WARN)
end, end,
hl = { fg = colors.yellow }, hl = { fg = colors.yellow },
icon = "", icon = "",
@ -169,7 +170,7 @@ components.active[1][8] = {
components.active[1][9] = { components.active[1][9] = {
provider = "diagnostic_hints", provider = "diagnostic_hints",
enabled = function() enabled = function()
return lsp.diagnostics_exist "Hint" return lsp.diagnostics_exist(lsp_severity.HINT)
end, end,
hl = { fg = colors.grey_fg2 }, hl = { fg = colors.grey_fg2 },
icon = "", icon = "",
@ -178,7 +179,7 @@ components.active[1][9] = {
components.active[1][10] = { components.active[1][10] = {
provider = "diagnostic_info", provider = "diagnostic_info",
enabled = function() enabled = function()
return lsp.diagnostics_exist "Information" return lsp.diagnostics_exist(lsp_severity.INFO)
end, end,
hl = { fg = colors.green }, hl = { fg = colors.green },
icon = "", icon = "",