Merge pull request #9987 from janlazo/vim-8.1.0865

vim-patch:8.1.{865,1299}
This commit is contained in:
Justin M. Keyes 2019-05-09 11:15:19 +02:00 committed by GitHub
commit b6ad206024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 5 deletions

View File

@ -678,8 +678,6 @@ static void win_update(win_T *wp)
mod_bot = wp->w_redraw_bot + 1; mod_bot = wp->w_redraw_bot + 1;
else else
mod_bot = 0; mod_bot = 0;
wp->w_redraw_top = 0; /* reset for next time */
wp->w_redraw_bot = 0;
if (buf->b_mod_set) { if (buf->b_mod_set) {
if (mod_top == 0 || mod_top > buf->b_mod_top) { if (mod_top == 0 || mod_top > buf->b_mod_top) {
mod_top = buf->b_mod_top; mod_top = buf->b_mod_top;
@ -776,6 +774,8 @@ static void win_update(win_T *wp)
if (mod_top != 0 && buf->b_mod_xlines != 0 && wp->w_p_nu) if (mod_top != 0 && buf->b_mod_xlines != 0 && wp->w_p_nu)
mod_bot = MAXLNUM; mod_bot = MAXLNUM;
} }
wp->w_redraw_top = 0; // reset for next time
wp->w_redraw_bot = 0;
/* /*
* When only displaying the lines at the top, set top_end. Used when * When only displaying the lines at the top, set top_end. Used when
@ -2446,7 +2446,9 @@ win_line (
} }
if (wp->w_p_list) { if (wp->w_p_list) {
if (curwin->w_p_lcs_chars.space || wp->w_p_lcs_chars.trail) { if (curwin->w_p_lcs_chars.space
|| wp->w_p_lcs_chars.trail
|| wp->w_p_lcs_chars.nbsp) {
extra_check = true; extra_check = true;
} }
// find start of trailing whitespace // find start of trailing whitespace
@ -3993,8 +3995,10 @@ win_line (
break; break;
} }
// line continues beyond line end // Show "extends" character from 'listchars' if beyond the line end and
if (wp->w_p_lcs_chars.ext // 'list' is set.
if (wp->w_p_lcs_chars.ext != NUL
&& wp->w_p_list
&& !wp->w_p_wrap && !wp->w_p_wrap
&& filler_todo <= 0 && filler_todo <= 0
&& (wp->w_p_rl ? col == 0 : col == grid->Columns - 1) && (wp->w_p_rl ? col == 0 : col == grid->Columns - 1)

View File

@ -90,6 +90,45 @@ func Test_listchars()
\ '.....h>-$', \ '.....h>-$',
\ 'iii<<<<><<$', '$'], l) \ 'iii<<<<><<$', '$'], l)
" test nbsp
normal ggdG
set listchars=nbsp:X,trail:Y
set list
" Non-breaking space
let nbsp = nr2char(0xa0)
call append(0, [ ">".nbsp."<" ])
let expected = '>X< '
redraw!
call cursor(1, 1)
call assert_equal([expected], ScreenLines(1, virtcol('$')))
set listchars=nbsp:X
redraw!
call cursor(1, 1)
call assert_equal([expected], ScreenLines(1, virtcol('$')))
" test extends
normal ggdG
set listchars=extends:Z
set nowrap
set nolist
call append(0, [ repeat('A', &columns + 1) ])
let expected = repeat('A', &columns)
redraw!
call cursor(1, 1)
call assert_equal([expected], ScreenLines(1, &columns))
set list
let expected = expected[:-2] . 'Z'
redraw!
call cursor(1, 1)
call assert_equal([expected], ScreenLines(1, &columns))
enew! enew!
set listchars& ff& set listchars& ff&
endfunc endfunc