romgrk / barbar.nvim

The neovim tabline plugin.
2.23k stars 83 forks source link

BufferPickDelete command gives error "Couldn't find buffer" #381

Closed tkivela closed 1 year ago

tkivela commented 1 year ago

I'm getting error after I use BufferPickDelete command.

To Reproduce:

  1. Open 1st buffer (example a.txt)
  2. Open 2nd buffer (example b.txt)
  3. Execute :BufferPickDelete
  4. Select first buffer (a.txt) to be deleted by typing shortcut a

Buffer is deleted, but I'm shown error:

Couldn't find buffer

If I click to the editor area after that I get another error:

Error executing Lua callback: ...local/share/nvim/lazy/barbar.nvim/lua/bufferline/api.lua:428: bad argument #1 to 'char' (number expected, got string)
stack traceback:
        [C]: in function 'char'
        ...local/share/nvim/lazy/barbar.nvim/lua/bufferline/api.lua:428: in function 'fn'
        ...local/share/nvim/lazy/barbar.nvim/lua/bufferline/api.lua:44: in function 'pick_buffer_wrap'
        ...local/share/nvim/lazy/barbar.nvim/lua/bufferline/api.lua:424: in function <...local/share/nvim/lazy/barbar
.nvim/lua/bufferline/api.lua:423>

Versions: NVIM v0.8.3 barbar.nvim version: master branch, commit de5682f

tkivela commented 1 year ago

I used the documented default configuration using lazy.nvim

require('lazy').setup {
  {'romgrk/barbar.nvim', dependencies = 'nvim-tree/nvim-web-devicons'},
}
Iron-E commented 1 year ago

Just tried to reproduce and didn't get "couldn't find buffer" (at least, not when I don't expect it). Could you upload a video or pictures + keystrokes to show what is happening precisely? Apologies for the inconvenience.

If I click to the editor area after that I get another error

I can reproduce this, I'll fix it.

Iron-E commented 1 year ago

387 should fix clicking giving you a strange error (it should clearly state the cause of the error now, i.e. clicking during :BufferPickDelete is "Invalid input")

tkivela commented 1 year ago

Thanks, good work, PR https://github.com/romgrk/barbar.nvim/pull/387 fixed the problem!

Iron-E commented 1 year ago

Oh, great! I'll close this, but feel free to reopen it if you end up feeling that it is still there.