akinsho / akinsho/bufferline.nvim

[Bug]: error when closing last tab

Abierto
#1,014 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Lua
Estrellas
4.4k
Forks
240
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.