Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
14874:370b606be092 | 14875:081f30c50300 |
---|---|
2174 { | 2174 { |
2175 if (wp->w_p_rnu) | 2175 if (wp->w_p_rnu) |
2176 { | 2176 { |
2177 // 'relativenumber' set: The text doesn't need to be drawn, but | 2177 // 'relativenumber' set: The text doesn't need to be drawn, but |
2178 // the number column nearly always does. | 2178 // the number column nearly always does. |
2179 (void)win_line(wp, lnum, srow, wp->w_height, TRUE, TRUE); | 2179 fold_count = foldedCount(wp, lnum, &win_foldinfo); |
2180 if (fold_count != 0) | |
2181 { | |
2182 fold_line(wp, fold_count, &win_foldinfo, lnum, row); | |
2183 --fold_count; | |
2184 } | |
2185 else | |
2186 (void)win_line(wp, lnum, srow, wp->w_height, TRUE, TRUE); | |
2180 } | 2187 } |
2181 | 2188 |
2182 // This line does not need to be drawn, advance to the next one. | 2189 // This line does not need to be drawn, advance to the next one. |
2183 row += wp->w_lines[idx++].wl_size; | 2190 row += wp->w_lines[idx++].wl_size; |
2184 if (row > wp->w_height) /* past end of screen */ | 2191 if (row > wp->w_height) /* past end of screen */ |
3313 { | 3320 { |
3314 /* Prepare for spell checking. */ | 3321 /* Prepare for spell checking. */ |
3315 has_spell = TRUE; | 3322 has_spell = TRUE; |
3316 extra_check = TRUE; | 3323 extra_check = TRUE; |
3317 | 3324 |
3318 /* Get the start of the next line, so that words that wrap to the next | 3325 /* Get the start of the next line, so that words that wrap to the |
3319 * line are found too: "et<line-break>al.". | 3326 * next line are found too: "et<line-break>al.". |
3320 * Trick: skip a few chars for C/shell/Vim comments */ | 3327 * Trick: skip a few chars for C/shell/Vim comments */ |
3321 nextline[SPWORDLEN] = NUL; | 3328 nextline[SPWORDLEN] = NUL; |
3322 if (lnum < wp->w_buffer->b_ml.ml_line_count) | 3329 if (lnum < wp->w_buffer->b_ml.ml_line_count) |
3323 { | 3330 { |
3324 line = ml_get_buf(wp->w_buffer, lnum + 1, FALSE); | 3331 line = ml_get_buf(wp->w_buffer, lnum + 1, FALSE); |
3325 spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN); | 3332 spell_cat_line(nextline + SPWORDLEN, line, SPWORDLEN); |
3326 } | 3333 } |
3327 | 3334 |
3328 /* When a word wrapped from the previous line the start of the current | 3335 /* When a word wrapped from the previous line the start of the |
3329 * line is valid. */ | 3336 * current line is valid. */ |
3330 if (lnum == checked_lnum) | 3337 if (lnum == checked_lnum) |
3331 cur_checked_col = checked_col; | 3338 cur_checked_col = checked_col; |
3332 checked_lnum = 0; | 3339 checked_lnum = 0; |
3333 | 3340 |
3334 /* When there was a sentence end in the previous line may require a | 3341 /* When there was a sentence end in the previous line may require a |