akinsho / akinsho/bufferline.nvim
[Bug]: GROUPS: filename/name not working
- 主要语言
- Lua
- 星标
- 4.4k
- 派生
- 240
- PR 合并指标
- 30 天内没有已合并 PR
描述
### Is there an existing issue for this?
- [x] I have searched the existing issues
### What happened?
I pasted the sample code from the readme:
```lua
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
highlight = {underline = true, sp = "blue"}, -- Optional
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 = true, sp = "green"},
auto_close = false, -- whether or not close this group if it doesn't contain the current buffer
matcher = function(buf)
return buf.filename:match('%.md') or buf.filename:match('%.txt')
end,
separator = { -- Optional
style = require('bufferline.groups').separator.tab
},
}
}
}
```
got this error:
```
Error 19:46:07 msg_show.lua_error E5108: Error executing lua ...sers/Henri/AppData/Local/nvim/lua/plugins/bufferline.lua:19: attempt to index field 'filename' (a nil value)
stack traceback:
...sers/Henri/AppData/Local/nvim/lua/plugins/bufferline.lua:19: in function 'matcher'
...nvim-data/lazy/bufferline.nvim/lua/bufferline/groups.lua:197: in function 'set_id'
...vim-data/lazy/bufferline.nvim/lua/bufferline/buffers.lua:74: in function 'get_components'
.../Local/nvim-data/lazy/bufferline.nvim/lua/bufferline.lua:56: in function <.../Local/nvim-data/lazy/bufferline.nvim/lua/bufferline.lua:54>
```
i tested a bit more and it seems like the field "filename" is completly missing
i found the field "name", and it seemed like this is the actuall "filename" but you get an error when indexing (a nil value) but its get listed when: vim.print(buf)
### What did you expect to happen?
Expected behaviour
### Config
---
### Additional Information
...
### commit
_No response_
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。