akinsho / akinsho/bufferline.nvim

[Bug]: First (most left) group doesn't collapse on mouse click

Ouverte
#720 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
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?

If I have several groups and assume they are in the following order "code", "docs", "cfg", I can collapse all but first one by mouse click. First group remains uncollapsed. BufferLineGroupToagle code command works though.

How to reproduce:
1. Have several groups with priorities (see config below) and several files in each group
2. Click on most left group
3. Click on any other group

Expected result
1. Groups exist, files in the groups exist - OK
2. Most left group got collapsed - OK
3. Group got collapsed - OK

Actual results
1. Groups exist, files in the groups exist - OK
2. Most left group got collapsed - NOK. Group remains un-collapsed
3. Group got collapsed - OK

I.e. collapse on mouse click works well on all groups except the most left one.
BufferLineGroupToggle works on all groups.

### What did you expect to happen?

Any group should be collapsed/uncollapsed on mouse click.

### Config

```
require('bufferline').setup {
options = {
show_duplicate_prefix = true,
always_show_bufferline = false,
diagnostics = 'nvim_lsp',
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local icon = level:match("error") and " " or " "
return " " .. icon .. count
end,
indicator = {
icon = '▎', -- this should be omitted if indicator style is not 'icon'
style = 'icon',
},
offsets = {
{
filetype = "NvimTree",
text = "",
text_align = "left",
separator = false,
}
},
groups = {
options = {
toggle_hidden_on_enter = true -- when you re-enter a hidden group this options re-opens that group so the buffer is visible
},
items = {
{
name = "Tests", -- Mandatory
auto_close = false, -- whether or not close this group if it doesn't contain the current buffer
priority = 2, -- determines where it will appear relative to other groups (Optional)
icon = "", -- Optional
matcher = function(buf) -- Mandatory
return buf.filename:match('%_test.*') or buf.filename:match('%_spec')
end,
},
{
name = "Docs",
--highlight = {undercurl = false, sp = "green"},
auto_close = false, -- whether or not close this group if it doesn't contain the current buffer
priority = 3, -- determines where it will appear relative to other groups (Optional)
matcher = function(buf)
return buf.filename:match('%.md') or buf.filename:match('%.txt')
end,
},
{
name = "Cfg",
auto_close = false, -- whether or not close this group if it doesn't contain the current buffer
priority = 4, -- determines where it will appear relative to other groups (Optional)
matcher = function(buf)
return buf.filename:match('%.yaml') or buf.filename:match('%.json')
end,
},
{
name = "Code",
auto_close = false, -- whether or not close this group if it doesn't contain the current buffer
priority = 1, -- determines where it will appear relative to other groups (Optional)
matcher = function(buf)
return buf.filename:match('%.go') or buf.filename:match('%.py')
end,
}
}
},
}
}

```

### Additional Information

...

### commit

_No response_

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.