summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-02-06 10:59:03 +0100
committerChristian Brabandt <cb@256bit.org>2024-02-06 10:59:03 +0100
commitebfd856cfdf6ea0b16c8d115000961c998ce97da (patch)
treec07e77f4b98e9bfd53d1e63ce21d912eba17e206
parentf7f33e3719c87279dfad109b874e2817007a1184 (diff)
patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped linesv9.1.0079
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>
-rw-r--r--src/drawline.c62
-rw-r--r--src/drawscreen.c5
-rw-r--r--src/testdir/dumps/Test_relnr_colors_wrapped_1.dump20
-rw-r--r--src/testdir/dumps/Test_relnr_colors_wrapped_2.dump20
-rw-r--r--src/testdir/dumps/Test_relnr_colors_wrapped_3.dump20
-rw-r--r--src/testdir/dumps/Test_relnr_colors_wrapped_4.dump20
-rw-r--r--src/testdir/dumps/Test_relnr_colors_wrapped_5.dump20
-rw-r--r--src/testdir/test_number.vim32
-rw-r--r--src/version.c2
9 files changed, 178 insertions, 23 deletions
diff --git a/src/drawline.c b/src/drawline.c
index daf3fbe18f..f6c01d5973 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -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
diff --git a/src/drawscreen.c b/src/drawscreen.c
index 5eb531db8e..960bd69118 100644
--- a/src/drawscreen.c
+++ b/src/drawscreen.c
@@ -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
index 0000000000..a0a269fdb5
--- /dev/null
+++ b/src/testdir/dumps/Test_relnr_colors_wrapped_1.dump
@@ -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
index 0000000000..1f2df5e09b
--- /dev/null
+++ b/src/testdir/dumps/Test_relnr_colors_wrapped_2.dump
@@ -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
index 0000000000..b6f6c606c8
--- /dev/null
+++ b/src/testdir/dumps/Test_relnr_colors_wrapped_3.dump
@@ -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
index 0000000000..b8389502dd
--- /dev/null
+++ b/src/testdir/dumps/Test_relnr_colors_wrapped_4.dump
@@ -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
index 0000000000..549275a431
--- /dev/null
+++ b/src/testdir/dumps/Test_relnr_colors_wrapped_5.dump
@@ -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|%|
diff --git a/src/testdir/test_number.vim b/src/testdir/test_number.vim
index 81f8f73013..6ac3c4cfe4 100644
--- a/src/testdir/test_number.vim
+++ b/src/testdir/test_number.vim
@@ -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
diff --git a/src/version.c b/src/version.c
index 99c74d0f8b..3d99917a75 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 79,
+/**/
78,
/**/
77,