summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-09-01 16:02:07 +0200
committerBram Moolenaar <Bram@vim.org>2021-09-01 16:02:07 +0200
commit04626c243c47af91c2580eaf23e12286180e0e81 (patch)
tree0d4a090980e722abfb0cccbc1ea2e3cb0317ee3c /src/diff.c
parent6631597452d4644f485a09e4036d117e5f91de70 (diff)
patch 8.2.3394: filler lines are wrong when changing text in diff modev8.2.3394
Problem: Filler lines are wrong when changing text in diff mode. Solution: Don't change the filler lines on every change. Check scrollbinding when updating the filler lines. (closes #8809)
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/diff.c b/src/diff.c
index 7bdfa48195..b59a125106 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -655,6 +655,8 @@ diff_redraw(
int dofold) // also recompute the folds
{
win_T *wp;
+ win_T *wp_other = NULL;
+ int used_max_fill = FALSE;
int n;
need_diff_redraw = FALSE;
@@ -662,6 +664,8 @@ diff_redraw(
if (wp->w_p_diff)
{
redraw_win_later(wp, SOME_VALID);
+ if (wp != curwin)
+ wp_other = wp;
#ifdef FEAT_FOLDING
if (dofold && foldmethodIsDiff(wp))
foldUpdateAll(wp);
@@ -674,10 +678,19 @@ diff_redraw(
if (wp->w_topfill > n)
wp->w_topfill = (n < 0 ? 0 : n);
else if (n > 0 && n > wp->w_topfill)
+ {
wp->w_topfill = n;
+ if (wp == curwin)
+ used_max_fill = 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);
}
static void