[PATCH v2 2/9] mergetools: vimdiff: shuffle single window case
We clearly want to do something different in these use cases.
No functional changes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
mergetools/vimdiff | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/mergetools/vimdiff b/mergetools/vimdiff
index ea416adcaa..9805d139bc 100644
--- a/mergetools/vimdiff
+++ b/mergetools/vimdiff
@@ -315,6 +315,14 @@ gen_cmd () {
LAYOUT=$1
+ # A single window is handled specially
+
+ if ! echo "$LAYOUT" | grep ",\|/" >/dev/null
+ then
+ CMD=$(gen_cmd_aux "$LAYOUT")
+ FINAL_CMD="-c \"$CMD | bufdo diffthis\" -c \"tabfirst\""
+ return
+ fi
# Search for a "@" in one of the files identifiers ("LOCAL", "BASE",
# "REMOTE", "MERGED"). If not found, use "MERGE" as the default file
@@ -334,18 +342,7 @@ gen_cmd () {
# Obtain the first part of vim "-c" option to obtain the desired layout
CMD=$(gen_cmd_aux "$LAYOUT")
-
-
- # Adjust the just obtained script depending on whether more than one
- # windows are visible or not
-
- if echo "$LAYOUT" | grep ",\|/" >/dev/null
- then
- CMD="$CMD | tabdo windo diffthis"
- else
- CMD="$CMD | bufdo diffthis"
- fi
-
+ CMD="$CMD | tabdo windo diffthis"
# Add an extra "-c" option to move to the first tab (notice that we
# can't simply append the command to the previous "-c" string as
--
2.37.1.378.g3f95da6bac