]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped lines v9.1.0079
authorzeertzjq <zeertzjq@outlook.com>
Tue, 6 Feb 2024 09:59:03 +0000 (10:59 +0100)
committerChristian Brabandt <cb@256bit.org>
Tue, 6 Feb 2024 09:59:03 +0000 (10:59 +0100)
Problem:  LineNrAbove and LineNrBelow background wrong on wrapped lines.
Solution: Update number column also for wrapped part of a line.
          (zeertzjq)

closes: #13974

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/drawline.c
src/drawscreen.c
src/testdir/dumps/Test_relnr_colors_wrapped_1.dump [new file with mode: 0644]
src/testdir/dumps/Test_relnr_colors_wrapped_2.dump [new file with mode: 0644]
src/testdir/dumps/Test_relnr_colors_wrapped_3.dump [new file with mode: 0644]
src/testdir/dumps/Test_relnr_colors_wrapped_4.dump [new file with mode: 0644]
src/testdir/dumps/Test_relnr_colors_wrapped_5.dump [new file with mode: 0644]
src/testdir/test_number.vim
src/version.c

index daf3fbe18f6848d7cd20c69ad4770037206ab4d7..f6c01d5973e64e513a706f4baac0cfbd628d9e5c 100644 (file)
@@ -1091,7 +1091,8 @@ apply_cursorline_highlight(
 /*
  * Display line "lnum" of window "wp" on the screen.
  * Start at row "startrow", stop when "endrow" is reached.
- * When "number_only" is TRUE only update the number column.
+ * When only updating the number column, "number_only" is set to the height of
+ * the line, otherwise it is set to 0.
  * "spv" is used to store information for spell checking, kept between
  * sequential calls for the same window.
  * wp->w_virtcol needs to be valid.
@@ -1273,7 +1274,7 @@ win_line(
     wlv.vcol_sbr = -1;
 #endif
 
-    if (!number_only)
+    if (number_only == 0)
     {
        // To speed up the loop below, set extra_check when there is linebreak,
        // trailing white space and/or syntax processing to be done.
@@ -1486,7 +1487,7 @@ win_line(
 #endif
 
 #ifdef FEAT_SPELL
-    if (spv->spv_has_spell && !number_only)
+    if (spv->spv_has_spell && number_only == 0)
     {
        // Prepare for spell checking.
        extra_check = TRUE;
@@ -1667,7 +1668,7 @@ win_line(
        }
     }
 
-    if (number_only)
+    if (number_only > 0)
     {
        // skip over rows only used for virtual text above
        wlv.row += wlv.text_prop_above_count;
@@ -1679,7 +1680,7 @@ win_line(
 
 #if defined(FEAT_LINEBREAK) || defined(FEAT_PROP_POPUP)
     colnr_T vcol_first_char = 0;
-    if (wp->w_p_lbr && !number_only)
+    if (wp->w_p_lbr && number_only == 0)
     {
        chartabsize_T cts;
        init_chartabsize_arg(&cts, wp, lnum, 0, line, line);
@@ -1695,7 +1696,7 @@ win_line(
        v = startrow == 0 ? wp->w_skipcol - skipcol_in_text_prop_above : 0;
     else
        v = wp->w_leftcol;
-    if (v > 0 && !number_only)
+    if (v > 0 && number_only == 0)
     {
        char_u          *prev_ptr = ptr;
        chartabsize_T   cts;
@@ -1840,7 +1841,7 @@ win_line(
     }
 
 #ifdef FEAT_SEARCH_EXTRA
-    if (!number_only)
+    if (number_only == 0)
     {
        v = (long)(ptr - line);
        area_highlighting |= prepare_search_hl_line(wp, lnum, (colnr_T)v,
@@ -1933,6 +1934,38 @@ win_line(
                wlv.draw_state = WL_NR;
                handle_lnum_col(wp, &wlv, sign_present, num_attr);
            }
+
+           // When only displaying the (relative) line number and that's done,
+           // stop here.
+           if (number_only > 0 && wlv.draw_state == WL_NR && wlv.n_extra == 0)
+           {
+               wlv_screen_line(wp, &wlv, TRUE);
+               // Need to update more screen lines if:
+               // - LineNrAbove or LineNrBelow is used, or
+               // - still drawing filler lines.
+               if ((wlv.row + 1 - wlv.startrow < number_only
+                       && (HL_ATTR(HLF_LNA) != 0 || HL_ATTR(HLF_LNB) != 0))
+#ifdef FEAT_DIFF
+                       || wlv.filler_todo > 0
+#endif
+                       )
+               {
+                   ++wlv.row;
+                   ++wlv.screen_row;
+                   if (wlv.row == endrow)
+                       break;
+#ifdef FEAT_DIFF
+                   --wlv.filler_todo;
+                   if (wlv.filler_todo == 0 && wp->w_botfill)
+                       break;
+#endif
+                   win_line_start(wp, &wlv, TRUE);
+                   continue;
+               }
+               else
+                   break;
+           }
+
 #ifdef FEAT_LINEBREAK
            // Check if 'breakindent' applies and show it.
            // May change wlv.draw_state to WL_BRI or WL_BRI - 1.
@@ -1957,22 +1990,13 @@ win_line(
        if (wlv.cul_screenline && wlv.draw_state == WL_LINE
                && wlv.vcol >= left_curline_col
                && wlv.vcol < right_curline_col)
-       {
            apply_cursorline_highlight(&wlv, sign_present);
-       }
 #endif
 
        // When still displaying '$' of change command, stop at cursor.
-       // When only displaying the (relative) line number and that's done,
-       // stop here.
-       if (((dollar_vcol >= 0 && wp == curwin
-                              && lnum == wp->w_cursor.lnum
-                              && wlv.vcol >= (long)wp->w_virtcol)
-               || (number_only && wlv.draw_state > WL_NR))
-#ifdef FEAT_DIFF
-                                  && wlv.filler_todo <= 0
-#endif
-               )
+       if (dollar_vcol >= 0 && wp == curwin
+               && lnum == wp->w_cursor.lnum
+               && wlv.vcol >= (long)wp->w_virtcol)
        {
            wlv_screen_line(wp, &wlv, TRUE);
            // Pretend we have finished updating the window.  Except when
index 5eb531db8e2b781501d46df2c3b02c87142f346b..960bd691188ed846d7dca2d5bfc22f2123662c90 100644 (file)
@@ -2503,7 +2503,7 @@ win_update(win_T *wp)
 #endif
 
                // Display one line.
-               row = win_line(wp, lnum, srow, wp->w_height, FALSE, &spv);
+               row = win_line(wp, lnum, srow, wp->w_height, 0, &spv);
 
 #ifdef FEAT_FOLDING
                wp->w_lines[idx].wl_folded = FALSE;
@@ -2550,7 +2550,8 @@ win_update(win_T *wp)
                    fold_line(wp, fold_count, &win_foldinfo, lnum, row);
                else
 #endif
-                   (void)win_line(wp, lnum, srow, wp->w_height, TRUE, &spv);
+                   (void)win_line(wp, lnum, srow, wp->w_height,
+                                              wp->w_lines[idx].wl_size, &spv);
            }
 
            // This line does not need to be drawn, advance to the next one.
diff --git a/src/testdir/dumps/Test_relnr_colors_wrapped_1.dump b/src/testdir/dumps/Test_relnr_colors_wrapped_1.dump
new file mode 100644 (file)
index 0000000..a0a269f
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000001#4040ff13@1|2| |1+0#0000000#ffffff0|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0
+| +0#0000001#4040ff13@3|8+0#0000000#ffffff0|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8| @17
+| +0#0000001#4040ff13@1|1| |1+0#0000000#ffffff0|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0
+| +0#0000001#4040ff13@3|9+0#0000000#ffffff0|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9| @17
+|1+0#0000001#ff404010@2| >1+0#0000000#ffffff0@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1
+| +0#0000001#ff404010@3|1+0#0000000#ffffff0|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1
+| +0#0000001#ff404010@3|0+0#0000000#ffffff0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0| @17
+| +0#0000001#40ff4011@1|1| |1+0#0000000#ffffff0@45
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0@45
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0@27| @17
+| +0#0000001#40ff4011@1|2| |1+0#0000000#ffffff0@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1
+| +0#0000001#40ff4011@3|2+0#0000000#ffffff0|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2| @17
+| +0#0000001#40ff4011@1|3| |1+0#0000000#ffffff0@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1
+| +0#0000001#40ff4011@3|3+0#0000000#ffffff0|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3| @17
+| +0#0000001#40ff4011@1|4| |1+0#0000000#ffffff0@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1|@+0#4040ff13&@2
+| +0#0000000&@31|1@2|,|1| @8|5@1|%| 
diff --git a/src/testdir/dumps/Test_relnr_colors_wrapped_2.dump b/src/testdir/dumps/Test_relnr_colors_wrapped_2.dump
new file mode 100644 (file)
index 0000000..1f2df5e
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000001#4040ff13@1|1| |1+0#0000000#ffffff0|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0
+| +0#0000001#4040ff13@3|8+0#0000000#ffffff0|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8| @17
+|1+0#0000001#ff404010@1|0| >1+0#0000000#ffffff0|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1
+| +0#0000001#ff404010@3|0+0#0000000#ffffff0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0
+| +0#0000001#ff404010@3|9+0#0000000#ffffff0|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9| @17
+| +0#0000001#40ff4011@1|1| |1+0#0000000#ffffff0@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1
+| +0#0000001#40ff4011@3|0+0#0000000#ffffff0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0| @17
+| +0#0000001#40ff4011@1|2| |1+0#0000000#ffffff0@45
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0@45
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0@27| @17
+| +0#0000001#40ff4011@1|3| |1+0#0000000#ffffff0@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1
+| +0#0000001#40ff4011@3|2+0#0000000#ffffff0|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2| @17
+| +0#0000001#40ff4011@1|4| |1+0#0000000#ffffff0@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1
+| +0#0000001#40ff4011@3|3+0#0000000#ffffff0|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3| @17
+| +0#0000001#40ff4011@1|5| |1+0#0000000#ffffff0@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1|@+0#4040ff13&@2
+| +0#0000000&@31|1@1|0|,|1| @8|5@1|%| 
diff --git a/src/testdir/dumps/Test_relnr_colors_wrapped_3.dump b/src/testdir/dumps/Test_relnr_colors_wrapped_3.dump
new file mode 100644 (file)
index 0000000..b6f6c60
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000001#4040ff13@1|3| |1+0#0000000#ffffff0|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0
+| +0#0000001#4040ff13@3|8+0#0000000#ffffff0|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8| @17
+| +0#0000001#4040ff13@1|2| |1+0#0000000#ffffff0|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0
+| +0#0000001#4040ff13@3|9+0#0000000#ffffff0|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9| @17
+| +0#0000001#4040ff13@1|1| |1+0#0000000#ffffff0@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1
+| +0#0000001#4040ff13@3|1+0#0000000#ffffff0|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0| @17
+|1+0#0000001#ff404010@1|2| >1+0#0000000#ffffff0@45
+| +0#0000001#ff404010@3|1+0#0000000#ffffff0@45
+| +0#0000001#ff404010@3|1+0#0000000#ffffff0@27| @17
+| +0#0000001#40ff4011@1|1| |1+0#0000000#ffffff0@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1
+| +0#0000001#40ff4011@3|2+0#0000000#ffffff0|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2| @17
+| +0#0000001#40ff4011@1|2| |1+0#0000000#ffffff0@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1
+| +0#0000001#40ff4011@3|3+0#0000000#ffffff0|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3| @17
+| +0#0000001#40ff4011@1|3| |1+0#0000000#ffffff0@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1|@+0#4040ff13&@2
+| +0#0000000&@31|1@1|2|,|1| @8|5@1|%| 
diff --git a/src/testdir/dumps/Test_relnr_colors_wrapped_4.dump b/src/testdir/dumps/Test_relnr_colors_wrapped_4.dump
new file mode 100644 (file)
index 0000000..b838950
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000001#4040ff13@1|5| |1+0#0000000#ffffff0|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0
+| +0#0000001#4040ff13@3|8+0#0000000#ffffff0|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8| @17
+| +0#0000001#4040ff13@1|4| |1+0#0000000#ffffff0|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0
+| +0#0000001#4040ff13@3|9+0#0000000#ffffff0|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9| @17
+| +0#0000001#4040ff13@1|3| |1+0#0000000#ffffff0@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1
+| +0#0000001#4040ff13@3|1+0#0000000#ffffff0|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0| @17
+| +0#0000001#4040ff13@1|2| |1+0#0000000#ffffff0@45
+| +0#0000001#4040ff13@3|1+0#0000000#ffffff0@45
+| +0#0000001#4040ff13@3|1+0#0000000#ffffff0@27| @17
+| +0#0000001#4040ff13@1|1| |1+0#0000000#ffffff0@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1
+| +0#0000001#4040ff13@3|1+0#0000000#ffffff0|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1
+| +0#0000001#4040ff13@3|2+0#0000000#ffffff0|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2| @17
+|1+0#0000001#ff404010@1|4| >1+0#0000000#ffffff0@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1
+| +0#0000001#ff404010@3|1+0#0000000#ffffff0|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1
+| +0#0000001#ff404010@3|3+0#0000000#ffffff0|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3| @17
+| +0#0000001#40ff4011@1|1| |1+0#0000000#ffffff0@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1|@+0#4040ff13&@2
+| +0#0000000&@31|1@1|4|,|1| @8|5@1|%| 
diff --git a/src/testdir/dumps/Test_relnr_colors_wrapped_5.dump b/src/testdir/dumps/Test_relnr_colors_wrapped_5.dump
new file mode 100644 (file)
index 0000000..549275a
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000001#4040ff13@1|4| |1+0#0000000#ffffff0|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0
+| +0#0000001#4040ff13@3|8+0#0000000#ffffff0|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8|1|0|8| @17
+| +0#0000001#4040ff13@1|3| |1+0#0000000#ffffff0|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0
+| +0#0000001#4040ff13@3|9+0#0000000#ffffff0|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9|1|0|9| @17
+| +0#0000001#4040ff13@1|2| |1+0#0000000#ffffff0@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1
+| +0#0000001#4040ff13@3|1+0#0000000#ffffff0|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1
+| +0#0000001#4040ff13@3|0+0#0000000#ffffff0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0|1@1|0| @17
+| +0#0000001#4040ff13@1|1| |1+0#0000000#ffffff0@45
+| +0#0000001#4040ff13@3|1+0#0000000#ffffff0@45
+| +0#0000001#4040ff13@3|1+0#0000000#ffffff0@27| @17
+|1+0#0000001#ff404010@1|3| >1+0#0000000#ffffff0@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1
+| +0#0000001#ff404010@3|1+0#0000000#ffffff0|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1
+| +0#0000001#ff404010@3|2+0#0000000#ffffff0|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2|1@1|2| @17
+| +0#0000001#40ff4011@1|1| |1+0#0000000#ffffff0@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1
+| +0#0000001#40ff4011@3|1+0#0000000#ffffff0|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1
+| +0#0000001#40ff4011@3|3+0#0000000#ffffff0|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3|1@1|3| @17
+| +0#0000001#40ff4011@1|2| |1+0#0000000#ffffff0@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1@1|4|1|@+0#4040ff13&@2
+| +0#0000000&@31|1@1|3|,|1| @8|5@1|%| 
index 81f8f73013dd7c9132d14c0df630d8848cc75768..6ac3c4cfe4adcb68fac6600f21b572edfc3a68f4 100644 (file)
@@ -278,9 +278,7 @@ func Test_relativenumber_colors()
   [CODE]
   call writefile(lines, 'XTest_relnr', 'D')
 
-  " Check that the balloon shows up after a mouse move
   let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50})
-  call TermWait(buf, 50)
   " Default colors
   call VerifyScreenDump(buf, 'Test_relnr_colors_1', {})
 
@@ -297,6 +295,36 @@ func Test_relativenumber_colors()
   call StopVimInTerminal(buf)
 endfunc
 
+func Test_relativenumber_colors_wrapped()
+  CheckScreendump
+
+  let lines =<< trim [CODE]
+    set display=lastline scrolloff=0
+    call setline(1, range(200)->map('v:val->string()->repeat(40)'))
+    111
+    set number relativenumber
+    hi LineNr ctermbg=red ctermfg=black
+    hi LineNrAbove ctermbg=blue ctermfg=black
+    hi LineNrBelow ctermbg=green ctermfg=black
+  [CODE]
+  call writefile(lines, 'XTest_relnr_wrap', 'D')
+
+  let buf = RunVimInTerminal('-S XTest_relnr_wrap', {'rows': 20, 'cols': 50})
+
+  call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_1', {})
+  call term_sendkeys(buf, "k")
+  call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_2', {})
+  call term_sendkeys(buf, "2j")
+  call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_3', {})
+  call term_sendkeys(buf, "2j")
+  call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_4', {})
+  call term_sendkeys(buf, "k")
+  call VerifyScreenDump(buf, 'Test_relnr_colors_wrapped_5', {})
+
+  " clean up
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_relativenumber_callback()
   CheckScreendump
   CheckFeature timers
index 99c74d0f8b7e93d4bb5e6f0705c2cbe995fb897d..3d99917a75fb2536ecd051360765026949c4e103 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    79,
 /**/
     78,
 /**/