mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.1.0865: when 'listchars' only contains "nbsp:X" it does not work
Problem: When 'listchars' only contains "nbsp:X" it does not work. Solution: Set extra_check when lcs_nbsp is set. (Ralf Schandl, closes #3889)
This commit is contained in:
parent
375e339007
commit
895d966e34
@ -1164,8 +1164,6 @@ 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)
|
||||||
@ -1277,6 +1275,8 @@ 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
|
||||||
@ -3498,7 +3498,7 @@ win_line(
|
|||||||
|
|
||||||
if (wp->w_p_list)
|
if (wp->w_p_list)
|
||||||
{
|
{
|
||||||
if (lcs_space || lcs_trail)
|
if (lcs_space || lcs_trail || lcs_nbsp)
|
||||||
extra_check = TRUE;
|
extra_check = TRUE;
|
||||||
/* find start of trailing whitespace */
|
/* find start of trailing whitespace */
|
||||||
if (lcs_trail)
|
if (lcs_trail)
|
||||||
|
@ -90,6 +90,26 @@ 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('$')))
|
||||||
|
|
||||||
enew!
|
enew!
|
||||||
set listchars& ff&
|
set listchars& ff&
|
||||||
endfunc
|
endfunc
|
||||||
|
@ -783,6 +783,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
865,
|
||||||
/**/
|
/**/
|
||||||
864,
|
864,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user