akinsho / akinsho/bufferline.nvim
[Bug]: Incorrect length of underline when display lsp diagnostics indicator
- Langage dominant
- Lua
- Étoiles
- 4.4k
- Forks
- 240
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### What happened?
When showing diagnostics indicator after lsp have been prepared, the underline is split, length is too small.

### What did you expect to happen?
The underline fill all length of the tab/buffer.
### Config
```lua
{
'akinsho/bufferline.nvim',
event = 'VeryLazy',
keys = {
{ 'bp', 'BufferLineTogglePin', desc = 'Toggle Pin' },
{ 'bP', 'BufferLineGroupClose ungrouped', desc = 'Delete Non-Pinned Buffers' },
{ 'bo', 'BufferLineCloseOthers', desc = 'Delete Other Buffers' },
{ 'br', 'BufferLineCloseRight', desc = 'Delete Buffers to the Right' },
{ 'bl', 'BufferLineCloseLeft', desc = 'Delete Buffers to the Left' },
{
'bq',
function()
MiniBufremove.delete()
end,
desc = '[Q]uit current [B]uffer',
},
{ '', 'BufferLineCyclePrev', desc = 'Prev Buffer' },
{ '', 'BufferLineCycleNext', desc = 'Next Buffer' },
{ '[b', 'BufferLineCyclePrev', desc = 'Prev Buffer' },
{ ']b', 'BufferLineCycleNext', desc = 'Next Buffer' },
{ '[B', 'BufferLineMovePrev', desc = 'Move buffer prev' },
{ ']B', 'BufferLineMoveNext', desc = 'Move buffer next' },
},
config = function(_, opts)
require('bufferline').setup(vim.tbl_deep_extend('force', opts, { ---@type bufferline.Options
options = {
indicator = { style = 'underline' },
always_show_bufferline = false,
diagnostics = 'nvim_lsp',
diagnostics_indicator = function(_, _, diagnostics_dict, _)
local s = ' '
for e, n in pairs(diagnostics_dict) do
local sym = e == 'error' and ' ' or (e == 'warning' and ' ' or ' ')
s = s .. sym
end
return s
end,
offsets = {
{
filetype = 'neo-tree',
text = 'Neo-Tee',
highlight = 'Document',
separator = '┃', -- TODO: choose a thinner symbol
},
},
color_icons = true,
show_buffer_close_icons = false,
tab_size = 15,
separator_style = 'slant',
custom_filter = function(buf, bufnums)
if vim.bo[buf].filetype == 'qf' then
return false
end
-- Ignore unnamed buffers
if vim.api.nvim_buf_get_name(buf) == '' then
return false
end
return true
end,
},
}))
-- Fix bufferline when restoring a session
vim.api.nvim_create_autocmd({ 'BufAdd', 'BufDelete' }, {
callback = function()
vim.schedule(function()
pcall(nvim_bufferline)
end)
end,
desc = 'Fix bufferline when restoring a session',
})
end,
}
```
### Additional Information
_No response_
### commit
0b2fd86
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.