akinsho / akinsho/bufferline.nvim

[Bug]: error when closing last tab

Aperta
#1,014 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Lua
Stelle
4.4k
Fork
240
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.