diff options
Diffstat (limited to 'src/drawline.c')
-rw-r--r-- | src/drawline.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/src/drawline.c b/src/drawline.c index 95ea3f025a..4d63fae34d 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -1684,6 +1684,27 @@ win_line( cts.cts_vcol += charsize; prev_ptr = cts.cts_ptr; MB_PTR_ADV(cts.cts_ptr); + if (wp->w_p_list) + { + in_multispace = *prev_ptr == ' ' && (*cts.cts_ptr == ' ' + || (prev_ptr > line && prev_ptr[-1] == ' ')); + if (!in_multispace) + multispace_pos = 0; + else if (cts.cts_ptr >= line + leadcol + && wp->w_lcs_chars.multispace != NULL) + { + ++multispace_pos; + if (wp->w_lcs_chars.multispace[multispace_pos] == NUL) + multispace_pos = 0; + } + else if (cts.cts_ptr < line + leadcol + && wp->w_lcs_chars.leadmultispace != NULL) + { + ++multispace_pos; + if (wp->w_lcs_chars.leadmultispace[multispace_pos] == NUL) + multispace_pos = 0; + } + } } wlv.vcol = cts.cts_vcol; ptr = cts.cts_ptr; @@ -2589,9 +2610,7 @@ win_line( #ifdef FEAT_LINEBREAK int c0; #endif -#ifdef FEAT_SPELL char_u *prev_ptr = ptr; -#endif // Get a character from the line itself. c = *ptr; @@ -2941,10 +2960,13 @@ win_line( } } #endif - in_multispace = c == ' ' - && ((ptr > line + 1 && ptr[-2] == ' ') || *ptr == ' '); - if (!in_multispace) - multispace_pos = 0; + if (wp->w_p_list) + { + in_multispace = c == ' ' && (*ptr == ' ' + || (prev_ptr > line && prev_ptr[-1] == ' ')); + if (!in_multispace) + multispace_pos = 0; + } // 'list': Change char 160 to 'nbsp' and space to 'space' // setting in 'listchars'. But not when the character is |