]> granicus.if.org Git - vim/commitdiff
patch 9.0.0649: no indication the first line is broken for 'smoothscroll' v9.0.0649
authorBram Moolenaar <Bram@vim.org>
Mon, 3 Oct 2022 15:44:12 +0000 (16:44 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 3 Oct 2022 15:44:12 +0000 (16:44 +0100)
Problem:    No indication when the first line is broken for 'smoothscroll'.
Solution:   Show "<<<" in the first line.

src/drawline.c
src/testdir/dumps/Test_smoothscroll_2.dump
src/testdir/dumps/Test_smoothscroll_3.dump
src/testdir/dumps/Test_smoothscroll_5.dump
src/testdir/dumps/Test_smoothscroll_6.dump
src/version.c

index 79ce5140e95549bbf053fd926fc0a6c3d6c9ddd7..793d8a9996970c27bff3dde7a7240632ecdcfceb 100644 (file)
@@ -739,6 +739,32 @@ text_prop_position(
 }
 #endif
 
+/*
+ * Call screen_line() using values from "wlv".
+ * Also takes care of putting "<<<" on the first line for 'smoothscroll'.
+ */
+    static void
+wlv_screen_line(win_T *wp, winlinevars_T *wlv, int negative_width)
+{
+    if (wlv->row == 0 && wp->w_skipcol > 0)
+    {
+       int off = (int)(current_ScreenLine - ScreenLines);
+
+       for (int i = 0; i < 3; ++i)
+       {
+           ScreenLines[off] = '<';
+           if (enc_utf8)
+               ScreenLinesUC[off] = 0;
+           ScreenAttrs[off] = HL_ATTR(HLF_AT);
+           ++off;
+       }
+    }
+
+    screen_line(wp, wlv->screen_row, wp->w_wincol, wlv->col,
+                   negative_width ? -wp->w_width : wp->w_width,
+                   wlv->screen_line_flags);
+}
+
 /*
  * Called when finished with the line: draw the screen line and handle any
  * highlighting until the right of the window.
@@ -820,8 +846,7 @@ draw_screen_line(win_T *wp, winlinevars_T *wlv)
     }
 #endif
 
-    screen_line(wp, wlv->screen_row, wp->w_wincol, wlv->col,
-                                         wp->w_width, wlv->screen_line_flags);
+    wlv_screen_line(wp, wlv, FALSE);
     ++wlv->row;
     ++wlv->screen_row;
 }
@@ -1730,8 +1755,7 @@ win_line(
 #endif
                )
        {
-           screen_line(wp, wlv.screen_row, wp->w_wincol, wlv.col, -wp->w_width,
-                                                       wlv.screen_line_flags);
+           wlv_screen_line(wp, &wlv, TRUE);
            // Pretend we have finished updating the window.  Except when
            // 'cursorcolumn' is set.
 #ifdef FEAT_SYN_HL
@@ -3670,13 +3694,12 @@ win_line(
                )
        {
 #ifdef FEAT_CONCEAL
-           screen_line(wp, wlv.screen_row, wp->w_wincol,
-                           wlv.col - wlv.boguscols,
-                                         wp->w_width, wlv.screen_line_flags);
+           wlv.col += wlv.boguscols;
+           wlv_screen_line(wp, &wlv, FALSE);
+           wlv.col -= wlv.boguscols;
            wlv.boguscols = 0;
 #else
-           screen_line(wp, wlv.screen_row, wp->w_wincol, wlv.col,
-                                         wp->w_width, wlv.screen_line_flags);
+           screen_line(wp, &wlv, FALSE);
 #endif
            ++wlv.row;
            ++wlv.screen_row;
index 1ab08a9a80a67dabadfa40e839f96f67c32ce50e..e8ca1a79ec7a78748a2f6384ff82c44a1276a4a4 100644 (file)
@@ -1,4 +1,4 @@
-|w+0&#ffffff0|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| 
+|<+0#4040ff13#ffffff0@2|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| 
 |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
 |l|i|n|e| |t|h|r|e@1| @29
 |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| 
index 184909360f9395892df38341efdeb3d2a68cad78..5c2ed949af5581ff255340087ed4f36395009639 100644 (file)
@@ -1,4 +1,4 @@
-|w+0&#ffffff0|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
+|<+0#4040ff13#ffffff0@2|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
 |l|i|n|e| |t|h|r|e@1| @29
 |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| 
 |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| @10
index 40478bb1de581eb4244f02e0bda7303f8e8759d8..b88bd3d6defd284ea8221c951dcf3951d2a27b54 100644 (file)
@@ -1,4 +1,4 @@
-|w+0&#ffffff0|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
+|<+0#4040ff13#ffffff0@2|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
 |l|i|n|e| |t|h|r|e@1| @29
 |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| 
 |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| @10
index 4ca7b35a9ead88be3712e0d83e9edb622b476caf..fb733568cef7a50acd048af985673aad73a02c03 100644 (file)
@@ -1,4 +1,4 @@
-|w+0&#ffffff0|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| 
+|<+0#4040ff13#ffffff0@2|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| 
 |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @20
 |l|i|n|e| |t|h|r|e@1| @29
 |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| 
index 7a5d4955efe159417968513cd7828b6c5ac3e7e8..24ca413c8927a7c08417e4f1c9d1cf0c15fddd45 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    649,
 /**/
     648,
 /**/