]> git.ipfire.org Git - thirdparty/git.git/commit - mergetools/vimdiff
mergetools: vimdiff: fix single window layouts
authorFelipe Contreras <felipe.contreras@gmail.com>
Wed, 10 Aug 2022 15:46:17 +0000 (10:46 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Aug 2022 19:39:35 +0000 (12:39 -0700)
commitb6014eeac0963ccad3f769fc6cdd09a4a64f478d
tree3be147341bcb7c8791ab0cf2862dc404366e8d8e
parentffcc33f6a6923ade435a65d6cba751b3b95e6fd8
mergetools: vimdiff: fix single window layouts

Layouts with a single window other than "MERGED" do not work (e.g.
"LOCAL" or "MERGED+LOCAL").

This is because as the documentation of bufdo says:

    The last buffer (or where an error occurred) becomes the current
    buffer.

And we do always do bufdo the end.

Additionally, we do it only once, when it should be per tab.

Fix this by doing it once per tab right after it's created and before
any buffer is switched.

Cc: Fernando Ramos <greenfoo@u92.eu>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Reviewed-by: Fernando Ramos <greenfoo@u92.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mergetools/vimdiff