famiu / bufdelete.nvim

Delete Neovim buffers without losing window layout
GNU General Public License v3.0
515 stars 16 forks source link

[Bug] Cannot use `:Bdelete` in terminal buffer #28

Closed mehalter closed 2 years ago

mehalter commented 2 years ago

Neovim version

NVIM v0.8.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Describe the bug

Unable to use :Bdelete or :Bdelete! in terminal buffer (also applies to the lua API with require("bufdelete").bufdelete(...))

To Reproduce Steps to reproduce the behavior:

  1. Open NeoVim (nvim)
  2. Open a terminal buffer (:terminal)
  3. Try to delete the buffer (:Bdelete or :Bdelete!)
  4. See error
Error executing Lua callback: ...te/pack/packer/opt/bufdelete.nvim/lua/bufdelete/init.lua:140: Vim:E89: term://~/.config/nvim/lua//221736:/bin/zsh will be killed (add ! to override)                                                                                     
stack traceback:                                                                                                                                                                                                                                                          
        [C]: in function 'bdelete'                                                                                                                                                                                                                                        
        ...te/pack/packer/opt/bufdelete.nvim/lua/bufdelete/init.lua:140: in function 'buf_kill'                                                                                                                                                                           
        ...te/pack/packer/opt/bufdelete.nvim/lua/bufdelete/init.lua:221: in function 'buf_kill_cmd'                                                                                                                                                                       
        ...te/pack/packer/opt/bufdelete.nvim/lua/bufdelete/init.lua:225: in function <...te/pack/packer/opt/bufdelete.nvim/lua/bufdelete/init.lua:225>    

Expected behavior

Close the terminal buffer

Does this error occur in the minimal init file? Yes, this error still occurs

Provide modified minimal_init.lua Not applicable, the provided minimal_init.lua file is sufficient for replicating this error.

Screenshots

2022-11-01_11:36:53_screenshot

Additional context

Terminal recording of this bug: https://asciinema.org/a/RmF9dYhGrlmSM7PMkebc21nkw

famiu commented 2 years ago

:Bdelete! in terminal buffer works fine for me. As for :Bdelete, that behavior is intended as it's the same as :bdelete

mehalter commented 2 years ago

I cannot replicate this behavior you are describing @famiu . As you can see in my recording that I am running :Bdelete! using the provided minimal configuration and am unable to close the terminal buffer

famiu commented 2 years ago

I cannot replicate this behavior you are describing @famiu . As you can see in my recording that I am running :Bdelete! using the provided minimal configuration and am unable to close the terminal buffer

Ah, it turns out I didn't pull my last two PRs for my config, sorry about that. Should be fixed with #30