1
0
forked from aniani/vim

patch 8.2.3394: filler lines are wrong when changing text in diff mode

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)
This commit is contained in:
Bram Moolenaar
2021-09-01 16:02:07 +02:00
parent 6631597452
commit 04626c243c
6 changed files with 86 additions and 1 deletions

View File

@@ -535,6 +535,10 @@ changed_window_setting_win(win_T *wp)
void
set_topline(win_T *wp, linenr_T lnum)
{
#ifdef FEAT_DIFF
linenr_T prev_topline = wp->w_topline;
#endif
#ifdef FEAT_FOLDING
// go to first of folded lines
(void)hasFoldingWin(wp, lnum, &lnum, NULL, TRUE, NULL);
@@ -546,7 +550,9 @@ set_topline(win_T *wp, linenr_T lnum)
wp->w_topline = lnum;
wp->w_topline_was_set = TRUE;
#ifdef FEAT_DIFF
wp->w_topfill = 0;
if (lnum != prev_topline)
// Keep the filler lines when the topline didn't change.
wp->w_topfill = 0;
#endif
wp->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_TOPLINE);
// Don't set VALID_TOPLINE here, 'scrolloff' needs to be checked.