akinsho / akinsho/bufferline.nvim

[Bug]: Incorrect length of underline when display lsp diagnostics indicator

Abierto
#970 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Lua
Estrellas
4.4k
Forks
240
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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.

![图片](https://github.com/user-attachments/assets/bb7d6d3b-4d89-41f5-9473-7eb8547262cf)

### 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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.