patch 9.1.1883: Wrong display with 'smoothscroll' with -diff

Commit: 
https://github.com/vim/vim/commit/e06e70f7b129e983b307be405c44449348ac470f
Author: zeertzjq <[email protected]>
Date:   Tue Oct 28 19:03:22 2025 +0000

    patch 9.1.1883: Wrong display with 'smoothscroll' with -diff
    
    Problem:  Wrong display with 'smoothscroll' when FEAT_DIFF is disabled.
    Solution: Use plines_correct_topline() (zeertzjq).
    
    closes: #18649
    
    Signed-off-by: zeertzjq <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/drawscreen.c b/src/drawscreen.c
index 0519940b1..3cd2514d5 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -1919,13 +1919,8 @@ win_update(win_T *wp)
                    // Correct the first entry for filler lines at the top
                    // when it won't get updated below.
                    if (wp->w_p_diff && bot_start > 0)
-                   {
-                       int n = plines_win_nofill(wp, wp->w_topline, FALSE)
-                             + wp->w_topfill - adjust_plines_for_skipcol(wp);
-                       if (n > wp->w_height)
-                           n = wp->w_height;
-                       wp->w_lines[0].wl_size = n;
-                   }
+                       wp->w_lines[0].wl_size = plines_correct_topline(wp,
+                                                         wp->w_topline, TRUE);
 #endif
                }
            }
@@ -2342,21 +2337,7 @@ win_update(win_T *wp)
                            ++new_rows;
                        else
 #endif
-                       {
-#ifdef FEAT_DIFF
-                           if (l == wp->w_topline)
-                           {
-                               int n = plines_win_nofill(wp, l, FALSE)
-                                                               + wp->w_topfill;
-                               n -= adjust_plines_for_skipcol(wp);
-                               if (n > wp->w_height)
-                                   n = wp->w_height;
-                               new_rows += n;
-                           }
-                           else
-#endif
-                               new_rows += plines_win(wp, l, TRUE);
-                       }
+                           new_rows += plines_correct_topline(wp, l, TRUE);
                        ++j;
                        if (new_rows > wp->w_height - row - 2)
                        {
diff --git a/src/move.c b/src/move.c
index 784103070..6f25c5d66 100644
--- a/src/move.c
+++ b/src/move.c
@@ -39,7 +39,7 @@ static void botline_forw(lineoff_T *lp);
 /*
  * Get the number of screen lines skipped with "wp->w_skipcol".
  */
-    int
+    static int
 adjust_plines_for_skipcol(win_T *wp)
 {
     if (wp->w_skipcol == 0)
@@ -58,7 +58,7 @@ adjust_plines_for_skipcol(win_T *wp)
  * whether it is the first line, whether w_skipcol is non-zero and limiting to
  * the window height.
  */
-    static int
+    int
 plines_correct_topline(win_T *wp, linenr_T lnum, int limit_winheight)
 {
     int n;
diff --git a/src/proto/move.pro b/src/proto/move.pro
index 4760ebc79..489e85010 100644
--- a/src/proto/move.pro
+++ b/src/proto/move.pro
@@ -1,5 +1,5 @@
 /* move.c */
-int adjust_plines_for_skipcol(win_T *wp);
+int plines_correct_topline(win_T *wp, linenr_T lnum, int limit_winheight);
 void set_valid_virtcol(win_T *wp, colnr_T vcol);
 int sms_marker_overlap(win_T *wp, int extra2);
 void update_topline_redraw(void);
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim
index 27f269a37..0d9d3d984 100644
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -277,6 +277,7 @@ endfunc
 
 func Test_smoothscroll_diff_mode()
   CheckScreendump
+  CheckFeature diff
 
   let lines =<< trim END
       vim9script
@@ -303,6 +304,7 @@ endfunc
 
 func Test_smoothscroll_diff_change_line_default()
   CheckScreendump
+  CheckFeature diff
 
   " Uses the new diffopt default with indent-heuristic and inline:char
   let lines =<< trim END
@@ -334,6 +336,7 @@ endfunc
 
 func Test_smoothscroll_diff_change_line()
   CheckScreendump
+  CheckFeature diff
 
   " Uses the old diffopt default
   let lines =<< trim END
diff --git a/src/version.c b/src/version.c
index ed9059da4..c34ae0734 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1883,
 /**/
     1882,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vDp9x-008GEC-30%40256bit.org.

Raspunde prin e-mail lui