mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-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 vim/vim#3889)
895d966e34
This commit is contained in:
parent
8330cc22af
commit
924f1173cb
@ -678,8 +678,6 @@ static void win_update(win_T *wp)
|
||||
mod_bot = wp->w_redraw_bot + 1;
|
||||
else
|
||||
mod_bot = 0;
|
||||
wp->w_redraw_top = 0; /* reset for next time */
|
||||
wp->w_redraw_bot = 0;
|
||||
if (buf->b_mod_set) {
|
||||
if (mod_top == 0 || 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)
|
||||
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
|
||||
@ -2446,7 +2446,9 @@ win_line (
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
// find start of trailing whitespace
|
||||
|
@ -90,6 +90,26 @@ func Test_listchars()
|
||||
\ '.....h>-$',
|
||||
\ '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!
|
||||
set listchars& ff&
|
||||
endfunc
|
||||
|
Loading…
Reference in New Issue
Block a user