vim-patch:8.2.3394: filler lines are wrong when changing text in diff mode (#15547)

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 vim/vim#8809)
04626c243c
This commit is contained in:
Jaehwang Jerry Jung
2021-09-19 01:38:58 +09:00
committed by GitHub
parent 51a98aa0c2
commit de406f651c
4 changed files with 115 additions and 3 deletions

View File

@@ -639,12 +639,18 @@ static int diff_check_sanity(tabpage_T *tp, diff_T *dp)
/// @param dofold Also recompute the folds
void diff_redraw(bool dofold)
{
win_T *wp_other = NULL;
bool used_max_fill = false;
need_diff_redraw = false;
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
if (!wp->w_p_diff) {
continue;
}
redraw_later(wp, SOME_VALID);
if (wp != curwin) {
wp_other = wp;
}
if (dofold && foldmethodIsDiff(wp)) {
foldUpdateAll(wp);
}
@@ -658,10 +664,18 @@ void diff_redraw(bool dofold)
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 clear_diffin(diffin_T *din)