akinsho / akinsho/bufferline.nvim

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

オープン
#720 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Lua
スター
4.4k
フォーク
240
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。