akinsho / akinsho/bufferline.nvim

[Bug]: error when closing last tab

未关闭
#1,014 0 条评论 0 个 reaction 已指派 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?

When using bufferline in `mode='tabs'`, closing the last tab (with the x-icon on the tab) shows an error message. (Because the last tab page cant be closed with `tabclose`)

### What did you expect to happen?

I expected to have an empty/new buffer left (and close all my other buffers from that tab).
OR
To not see an x icon at all.

### Config

With lazyvim:
```lua
return {
'akinsho/bufferline.nvim',
version = "*",
dependencies = {
'nvim-tree/nvim-web-devicons',
},
config = function()
vim.opt.termguicolors = true
require("bufferline").setup {
options = {
mode = 'tabs'
}
}
end,
}
```

### Additional Information

The error message:
```lua
E5108: Error executing lua vim/_editor.lua:0: nvim_exec2(), line 1: Vim(tabclose):E784: Cannot close last
tab page
stack traceback:
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
.../nvim/lazy/bufferline.nvim/lua/bufferline/utils/init.lua:169: in function 'command'
...re/nvim/lazy/bufferline.nvim/lua/bufferline/commands.lua:42: in function 'handle_user_command'

...re/nvim/lazy/bufferline.nvim/lua/bufferline/commands.lua:62: in function <...re/nvim/lazy/buff
erline.nvim/lua/bufferline/commands.lua:59>
```

### commit

_No response_

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。