style: improve diagnostics display on tabs
This commit is contained in:
@@ -9,19 +9,21 @@ return {
|
|||||||
numbers = 'both', -- or buffer_id
|
numbers = 'both', -- or buffer_id
|
||||||
separator_style = 'slant',
|
separator_style = 'slant',
|
||||||
diagnostics = 'nvim_lsp',
|
diagnostics = 'nvim_lsp',
|
||||||
-- diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
-- local s = " "
|
local s = ' '
|
||||||
-- for e, n in pairs(diagnostics_dict) do
|
for e, n in pairs(diagnostics_dict) do
|
||||||
-- local sym = e == "error" and " " or (e == "warning" and " " or " ")
|
local sym = e == 'error' and ' ' or (e == 'warning' and ' ' or ' ')
|
||||||
-- s = s .. n .. sym
|
s = s .. n .. sym
|
||||||
-- end
|
end
|
||||||
-- return s
|
|
||||||
-- end,
|
if context.buffer:current() then return '' end
|
||||||
|
|
||||||
|
return s
|
||||||
|
end,
|
||||||
always_show_bufferline = false,
|
always_show_bufferline = false,
|
||||||
show_tab_indicators = false,
|
show_tab_indicators = false,
|
||||||
color_icons = true,
|
color_icons = true,
|
||||||
show_buffer_icons = true,
|
show_buffer_icons = true,
|
||||||
persist_buffer_sort = true,
|
|
||||||
indicator = {
|
indicator = {
|
||||||
style = 'underline',
|
style = 'underline',
|
||||||
},
|
},
|
||||||
@@ -41,6 +43,7 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
sort_by = 'insert_at_end',
|
sort_by = 'insert_at_end',
|
||||||
|
persist_buffer_sort = true,
|
||||||
custom_areas = {
|
custom_areas = {
|
||||||
right = function()
|
right = function()
|
||||||
local result = {}
|
local result = {}
|
||||||
@@ -51,12 +54,10 @@ return {
|
|||||||
local hint = #vim.diagnostic.get(0, { severity = seve.HINT })
|
local hint = #vim.diagnostic.get(0, { severity = seve.HINT })
|
||||||
|
|
||||||
if error ~= 0 then table.insert(result, { text = ' ' .. error, link = 'DiagnosticError' }) end
|
if error ~= 0 then table.insert(result, { text = ' ' .. error, link = 'DiagnosticError' }) end
|
||||||
|
|
||||||
if warning ~= 0 then table.insert(result, { text = ' ' .. warning, link = 'DiagnosticWarn' }) end
|
if warning ~= 0 then table.insert(result, { text = ' ' .. warning, link = 'DiagnosticWarn' }) end
|
||||||
|
|
||||||
if hint ~= 0 then table.insert(result, { text = ' ' .. hint, link = 'DiagnosticHint' }) end
|
if hint ~= 0 then table.insert(result, { text = ' ' .. hint, link = 'DiagnosticHint' }) end
|
||||||
|
|
||||||
if info ~= 0 then table.insert(result, { text = ' ' .. info, link = 'DiagnosticInfo' }) end
|
if info ~= 0 then table.insert(result, { text = ' ' .. info, link = 'DiagnosticInfo' }) end
|
||||||
|
|
||||||
return result
|
return result
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user