Closed SamuilDichev closed 7 months ago
As you intuited, the close button and close command do indeed have different functionality.
The commands provided by this plugin were designed with the intention of being familiar for those who know the builtin Vim buffer commands (:bdelete
, :bwipeout
, :bnext
, :bprevious
, etc). For example:
bd foo " close buffer 'foo'
BufferClose foo " close buffer 'foo', preserving layout
bd! foo " force close buffer 'foo'
BufferClose! foo " force close buffer 'foo', preserving layout
However when clicking the UI there's no way to distinguish between a click to "close" and a click to "force close" (at least not in Vim, that I know of), which is where the dialogue came from.
We could certainly investigate adding a new command or config setting which enables this interactivity elsewhere.
Note: It switches to the left tab before I've confirmed the prompt. Should it? Seems premature. Is that another bug?
I'll have to investigate this, thank you for bringing it to my attention!
I did a little digging, turns out this already exists!
Just do this:
confirm BufferClose
That's it! Works perfect, thanks!
Description
Trying to close a
:term
buffer with:BufferClose
tells me it will be killed and that I need to add!
to override. On the other hand, clicking the X in the UI, prompts me whether I really want to close it or not. Which sounds more desirable.So UI closure works fine, just not
:BufferClose
. I would have assumed they'd do the same thing internally, but I guess not?To Reproduce
:term
and open a terminal in a new "tab" / buffer:BufferClose
Screenshots Pressing the X in UI works like so:
Note: It switches to the left tab before I've confirmed the prompt. Should it? Seems premature. Is that another bug?
And
:BufferClose
Informations Neovim version: v0.10.0-dev