Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mehalter opened this issue Nov 1, 2022 · 3 comments · Fixed by #30
Closed

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

mehalter opened this issue Nov 1, 2022 · 3 comments · Fixed by #30
Labels
bug Something isn't working

Comments

@mehalter
Copy link
Contributor

mehalter commented Nov 1, 2022

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

@mehalter mehalter added the bug Something isn't working label Nov 1, 2022
@famiu
Copy link
Owner

famiu commented Nov 2, 2022

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

@mehalter
Copy link
Contributor Author

mehalter commented Nov 2, 2022

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 added a commit that referenced this issue Nov 2, 2022
Terminal buffers did not close properly with `:Bdelete!` due to `force`
not being used unless the buffer was modified. Fix that by always using
`force` when it's explicitly enabled.

Closes #28.
@famiu famiu closed this as completed in #30 Nov 2, 2022
famiu added a commit that referenced this issue Nov 2, 2022
Terminal buffers did not close properly with `:Bdelete!` due to `force`
not being used unless the buffer was modified. Fix that by always using
`force` when it's explicitly enabled.

Closes #28.
@famiu
Copy link
Owner

famiu commented Nov 2, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants