Related: tpope/vim-fugitive#2286
The user notes that if you have a 'winfixbuf', then :bdelete, the current buffer is changed because the previous buffer was deleted. But the window is still 'winfixbuf'-ed so effectively the window points to a different buffer. Is that the behavior that we want?
If not that, here's some alternative ideas:
E1513 error) to delete the buffer because a window is 'winfixbuf'-ed to it'winfixbuf' on all windows that point to the buffer'winfixbuf' + :bdelete - Fails with E1513 error'winfixbuf' + :bdelete! - Deletes the buffer and unsets all other windowsIf not (4) then we'll want to consider changing
(please reply with any commands that I'm missing)
:bdelete:bwipeout:bunload (I don't use this option much)And also vimscript functions likely will need to be modified
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thanks for keeping up with those issues related to 'winfixbuf'. I would think 3 makes the most sense (including bunload and bwipe).
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
It's my pleasure, I knew we wouldn't get every edge case on the first go-around. I agree, (3) is good, I'll hop on that
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Thinking about :bwipeout, how should that logic work?
If 2 windows, one of them is 'winfixbuf' and the other is not (and the cursor is currently on the 'nowinfixbuf' window), I could imagine :bwipeout having one of two behaviors
'winfixbuf' window but delete any other buffers'winfixbuf' window was foundAnd then of course :bwipeout! would clear all buffers, even if any of the windows are 'winfixbuf', and the final window that remains gets set to 'nowinfixbuf'.
What do you think @chrisbra?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I've got most of the logic working, just need to figure out the best way to handle the bwipeout case. @chrisbra do you have a moment to check out these options? I'm partial to (2) but wanted to get your thoughts. If busy, no worries, I can put up a PR and discuss it there too.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
so if I understand correctly, you are saying you would prefer the following behaviour:
I have 2 windows open for fileA and fileB. Window1 has fileA and is 'winfixbuf'ed. I am in Window2 with fileB that does not have winfixbuf set and I want to wipe it. You would like to stop the :bwipe just because an unrelated window with an unrelated file has winfixbuf option set? I think this is more annoying than helpful. I think 1) makes more sense, no?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Oh my bad, I reread the :help bwipeout. Somehow in my mind I thought :bwipeout deletes all buffers but of course that's actually :%bwipeout. :bwipeout by itself only considers the current buffer (and its window(s))
As you suggested (1) is better after all. And I assume you'd want :bwipeout! to force-delete and then set any leftover window(s) to 'nowinfixbuf' like we've been doing for other commands, right? I can get started on that
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
yes, correct. Thanks for starting working on that,
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I think :bd should delete the buffer, and current windows's winfixbuf change to false. if there is only one windows, :bd will delete current buffer, and the previous buffer will bu set to current windows. if the prev buf is a normal file. maybe the windows should be normal windows. and if there are more then one windows. :bd just close the windows.
.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()