diff src/screen.c @ 14875:081f30c50300 v8.1.0449

patch 8.1.0449: when 'rnu' is set folded lines are not displayed correctly commit https://github.com/vim/vim/commit/7701f308565fdc7b5096a6597d9c3b63de0bbcec Author: Bram Moolenaar <Bram@vim.org> Date: Tue Oct 2 21:20:32 2018 +0200 patch 8.1.0449: when 'rnu' is set folded lines are not displayed correctly Problem: When 'rnu' is set folded lines are not displayed correctly. (Vitaly Yashin) Solution: When only redrawing line numbers do draw folded lines. (closes #3484)
author Christian Brabandt <cb@256bit.org>
date Tue, 02 Oct 2018 21:30:06 +0200
parents 27b9a84395b5
children 8b6124732e8f
line wrap: on
line diff
--- a/src/screen.c
+++ b/src/screen.c
@@ -2176,7 +2176,14 @@ win_update(win_T *wp)
 	    {
 		// 'relativenumber' set: The text doesn't need to be drawn, but
 		// the number column nearly always does.
-		(void)win_line(wp, lnum, srow, wp->w_height, TRUE, TRUE);
+		fold_count = foldedCount(wp, lnum, &win_foldinfo);
+		if (fold_count != 0)
+		{
+		    fold_line(wp, fold_count, &win_foldinfo, lnum, row);
+		    --fold_count;
+		}
+		else
+		    (void)win_line(wp, lnum, srow, wp->w_height, TRUE, TRUE);
 	    }
 
 	    // This line does not need to be drawn, advance to the next one.
@@ -3315,8 +3322,8 @@ win_line(
 	    has_spell = TRUE;
 	    extra_check = TRUE;
 
-	    /* Get the start of the next line, so that words that wrap to the next
-	     * line are found too: "et<line-break>al.".
+	    /* Get the start of the next line, so that words that wrap to the
+	     * next line are found too: "et<line-break>al.".
 	     * Trick: skip a few chars for C/shell/Vim comments */
 	    nextline[SPWORDLEN] = NUL;
 	    if (lnum < wp->w_buffer->b_ml.ml_line_count)
@@ -3325,8 +3332,8 @@ win_line(
 		spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN);
 	    }
 
-	    /* When a word wrapped from the previous line the start of the current
-	     * line is valid. */
+	    /* When a word wrapped from the previous line the start of the
+	     * current line is valid. */
 	    if (lnum == checked_lnum)
 		cur_checked_col = checked_col;
 	    checked_lnum = 0;