Closed alloc33 closed 1 year ago
and open diffview while staying, let's say, on tab 1
You can't open a diffview while staying on a tab page. Diffview opens in its own tab page.
when I close diffview it brings me to the next tab (tab 2).
This is default behavior for :tabclose
. Sounds like what you want is something like:
:tabn # | tabc #
@sindrets Here is what I mean. On the video you can see that I have 2 tabs. One tab with rust file buffer and another tab with terminal. If I open current file history from a tab with rust buffer and close it - diffview brings me to the second tab with terminal.
I understood what you meant. I'm trying to explain that this is default vim behavior with tabs. When you close one tab, vim drops you into the next.
https://user-images.githubusercontent.com/2786478/223794714-a7f5b4ba-7248-42b5-9010-c7382052b5c2.mp4
:DiffviewClose
does the same as :tabclose
. It only exists for the sake of symmetry with :DiffviewOpen
.
Again, it sounds like what you're trying to do is:
" Go to the last accessed tab page (#), then close the diffview
" (which would at that point be the "last accessed tab page")
:tabn # | tabc #
Is that correct? Shouldn't it be :tabnext # " go to the last accessed tab page
(:tabnext
instead of :tab
), see :h tabnext
?
@gegoune yes, you're right. My bad, this is what I get for confidently typing out vimscript without testing it first haha :) I'll edit my previous comments.
If I have 2 or more tabs and open diffview while staying, let's say, on tab 1 - when I close diffview it brings me to the next tab (tab 2). Expecting that it will not jumps to the next tab on diffview close. Is this a bug or we can set it up in config?