summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-10-22 20:56:55 +0100
committerBram Moolenaar <Bram@vim.org>2021-10-22 20:56:55 +0100
commit841c225b9ef8c5bdf5e02968a0bd62521fff6ca8 (patch)
tree05e85434a0e81ecede802cf640547dfe2f5e7486 /src/diff.c
parent25def2c8b8bd7b0c3d5f020207c717a880b05d50 (diff)
patch 8.2.3556: filler lines are incorrect for other window in diff modev8.2.3556
Problem: Filler lines are incorrect for other window in diff mode after making a change. Solution: Copy filler lines from the current window. (closes #8809)
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/diff.c b/src/diff.c
index b59a125106..92a4d9f44e 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -656,7 +656,8 @@ diff_redraw(
{
win_T *wp;
win_T *wp_other = NULL;
- int used_max_fill = FALSE;
+ int used_max_fill_other = FALSE;
+ int used_max_fill_curwin = FALSE;
int n;
need_diff_redraw = FALSE;
@@ -681,16 +682,25 @@ diff_redraw(
{
wp->w_topfill = n;
if (wp == curwin)
- used_max_fill = TRUE;
+ used_max_fill_curwin = TRUE;
+ else if (wp_other != NULL)
+ used_max_fill_other = TRUE;
}
check_topfill(wp, FALSE);
}
}
- if (wp_other != NULL && used_max_fill && curwin->w_p_scb)
- // The current window was set to used the maximum number of filler
- // lines, may need to reduce them.
- diff_set_topline(wp_other, curwin);
+ if (wp_other != NULL && curwin->w_p_scb)
+ {
+ if (used_max_fill_curwin)
+ // The current window was set to used the maximum number of filler
+ // lines, may need to reduce them.
+ diff_set_topline(wp_other, curwin);
+ else if (used_max_fill_other)
+ // The other window was set to used the maximum number of filler
+ // lines, may need to reduce them.
+ diff_set_topline(curwin, wp_other);
+ }
}
static void