[vim/vim] Enhancement: bwipeout should also remove buffer from jump list (#8201)

35 views
Skip to first unread message

joeytwiddle

unread,
May 12, 2021, 6:52:49 AM5/12/21
to vim/vim, Subscribed

Problem

I am working with multiple buffers open, and I open a new file, but I made a mistake and it was not the file I wanted, in fact it wasn't at all relevant to my current work. So I do :bwipeout! to close that buffer. This brings the focus back to my previous buffer, okay fine.

Unfortunately if at any point in future I start using CTRL-O to get back to where I was working earlier, now the unwanted file is in the jump list, and that file opens again!

This is undesirable, since I did bwipeout! specifically because I didn't want to work with that file any more. I cannot think of a situation where this behaviour would be desirable.

Proposed solution

When using bwipeout or bwipeout! I would like all references to that buffer dropped from the jump list. (And indeed from anywhere else it my be references in Vim's state.)

Alternative: When doing jumps, do not open any files which are not already open. Unfortunately, that would significantly change Vim's traditional behaviour. However it might be acceptable if the new behaviour was behind an option, and disabled by default.

Additional

Should this new behaviour apply to bdel and bdel! as well?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Bram Moolenaar

unread,
May 15, 2021, 8:25:39 AM5/15/21
to vim/vim, Subscribed


> ### Problem

>
> I am working with multiple buffers open, and I open a new file, but I made a mistake and it was not the file I wanted, in fact it wasn't at all relevant to my current work. So I do `:bwipeout!` to close that buffer. This brings the focus back to my previous buffer, okay fine.
>
> Unfortunately if at any point in future I start using CTRL-O to get back to where I was working earlier, now the unwanted file is in the jump list, and that file opens again!
>
> This is undesirable, since I did `bwipeout!` specifically because I didn't want to work with that file any more. I cannot think of a situation where this behaviour would be desirable.
>
> ### Proposed solution

>
> When using `bwipeout` or `bwipeout!` I would like all references to that buffer dropped from the jump list. (And indeed from anywhere else it my be references in Vim's state.)
>
> Alternative: When doing jumps, do not open any files which are not already open. Unfortunately, that would significantly change Vim's traditional behaviour. However it might be acceptable if the new behaviour was behind an option, and disabled by default.
>
> ### Additional

>
> Should this new behaviour apply to `bdel` and `bdel!` as well?

I think it makes sense that when doing :bwipe! the buffer references are
removed. It's basically saying "forget about this buffer completely".
It's not 100% backwards compatible, but I doubt that anyone will notice.

Implementation is going to be some work.

--
ARTHUR: (as the MAN next to him is squashed by a sheep) Knights! Run away!
Midst echoing shouts of "run away" the KNIGHTS retreat to cover with the odd
cow or goose hitting them still. The KNIGHTS crouch down under cover.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Christian Brabandt

unread,
Jul 9, 2024, 2:06:42 PM7/9/24
to vim/vim, Subscribed

Closed #8201 as completed via 4ff3a9b.


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/8201/issue_event/13444391432@github.com>

Reply all
Reply to author
Forward
0 new messages