akinsho / akinsho/bufferline.nvim

[Bug]: BufferLineCycleNext/Prev doesn't descend into closed groups

Đang mở
#980 0 bình luận 1 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Lua
Star
4.4k
Fork
240
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Is there an existing issue for this?

- [X] I have searched the existing issues

### What happened?

`BufferLineCycleNext`/`Prev` only cycles between ungrouped buffers and open groups. Groups whose buffers are closed are not opened.

### What did you expect to happen?

`BufferLineCycleNext`/`Prev` should cycle through adjacent buffers regardless of whether their group is open or closed. If cycling into a group that's closed, the group should open, and close automatically upon leaving the group if `auto_close` is set to `true`.

### Config

I load `bufferline` with `lazy` and `require` the following module via the `config` parameter:

```lua
local keymap = vim.keymap.set
keymap("n", "bp", "BufferLineTogglePin", { noremap = true, silent = true, desc = "[P]in buffer" })
keymap("n", "bh", "BufferLineMovePrev", { noremap = true, silent = true, desc = "Move buffer left" })
keymap("n", "bl", "BufferLineMoveNext", { noremap = true, silent = true, desc = "Move buffer right" })
keymap("n", "", "BufferLineCyclePrev", { noremap = true, silent = true, desc = "Prev buffer" }) -- NOTE: doesn't seem to enter groups
keymap("n", "", "BufferLineCycleNext", { noremap = true, silent = true, desc = "Next buffer" }) -- NOTE: doesn't seem to enter groups

return function()
local groups = require("bufferline.groups").builtin
require("bufferline").setup(
{
options = {
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level)
local icon = level:match("error") and " " or " "
return " " .. icon .. count
end,
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 = {
-- show pinned buffers first, then all ungrouped buffers, then docs then tests
groups.pinned:with({ icon = "󰐃 " }),
groups.ungrouped,
{
name = "Docs ",
highlight = { underline = true, sp = "#FC6F03" },
auto_close = true,
matcher = function(buf)
local filename = vim.api.nvim_buf_get_name(buf.id)
return filename:match("%.md") or filename:match("%.txt")
end,
},
{
name = "Tests ",
highlight = { underline = true, sp = "#036FFC" },
auto_close = true,
-- icon = " ",
matcher = function(buf)
local filename = vim.api.nvim_buf_get_name(buf.id)
return filename:match("%test_")
end,
},
},
},
color_icons = true,
highlights = {
tab_selected = {
bg = {
attribute = "fg",
highlight = "Pmenu",
},
},
},
indicator = { style = "underline" }, -- doesn't seem to be working
separator_style = { " ", " " },
},
}
)
end
```

### Additional Information

...

### commit

5cc447c

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.