mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 9.0.1938: multispace wrong when scrolling horizontally
Problem: multispace wrong when scrolling horizontally Solution: Update position in "multispace" or "leadmultispace" also in skipped chars. Reorder conditions to be more consistent. closes: #13145 closes: #13147 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
committed by
Christian Brabandt
parent
46a0582ffa
commit
abc808112e
@@ -1684,6 +1684,27 @@ win_line(
|
|||||||
cts.cts_vcol += charsize;
|
cts.cts_vcol += charsize;
|
||||||
prev_ptr = cts.cts_ptr;
|
prev_ptr = cts.cts_ptr;
|
||||||
MB_PTR_ADV(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;
|
wlv.vcol = cts.cts_vcol;
|
||||||
ptr = cts.cts_ptr;
|
ptr = cts.cts_ptr;
|
||||||
@@ -2589,9 +2610,7 @@ win_line(
|
|||||||
#ifdef FEAT_LINEBREAK
|
#ifdef FEAT_LINEBREAK
|
||||||
int c0;
|
int c0;
|
||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_SPELL
|
|
||||||
char_u *prev_ptr = ptr;
|
char_u *prev_ptr = ptr;
|
||||||
#endif
|
|
||||||
|
|
||||||
// Get a character from the line itself.
|
// Get a character from the line itself.
|
||||||
c = *ptr;
|
c = *ptr;
|
||||||
@@ -2941,10 +2960,13 @@ win_line(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
in_multispace = c == ' '
|
if (wp->w_p_list)
|
||||||
&& ((ptr > line + 1 && ptr[-2] == ' ') || *ptr == ' ');
|
{
|
||||||
|
in_multispace = c == ' ' && (*ptr == ' '
|
||||||
|
|| (prev_ptr > line && prev_ptr[-1] == ' '));
|
||||||
if (!in_multispace)
|
if (!in_multispace)
|
||||||
multispace_pos = 0;
|
multispace_pos = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// 'list': Change char 160 to 'nbsp' and space to 'space'
|
// 'list': Change char 160 to 'nbsp' and space to 'space'
|
||||||
// setting in 'listchars'. But not when the character is
|
// setting in 'listchars'. But not when the character is
|
||||||
|
@@ -2005,10 +2005,13 @@ msg_prt_line(char_u *s, int list)
|
|||||||
{
|
{
|
||||||
attr = 0;
|
attr = 0;
|
||||||
c = *s++;
|
c = *s++;
|
||||||
in_multispace = c == ' '
|
if (list)
|
||||||
&& ((col > 0 && s[-2] == ' ') || *s == ' ');
|
{
|
||||||
|
in_multispace = c == ' ' && (*s == ' '
|
||||||
|
|| (col > 0 && s[-2] == ' '));
|
||||||
if (!in_multispace)
|
if (!in_multispace)
|
||||||
multispace_pos = 0;
|
multispace_pos = 0;
|
||||||
|
}
|
||||||
if (c == TAB && (!list || curwin->w_lcs_chars.tab1))
|
if (c == TAB && (!list || curwin->w_lcs_chars.tab1))
|
||||||
{
|
{
|
||||||
// tab amount depends on current column
|
// tab amount depends on current column
|
||||||
@@ -2062,7 +2065,7 @@ msg_prt_line(char_u *s, int list)
|
|||||||
}
|
}
|
||||||
else if (c == ' ')
|
else if (c == ' ')
|
||||||
{
|
{
|
||||||
if (list && lead != NULL && s <= lead && in_multispace
|
if (lead != NULL && s <= lead && in_multispace
|
||||||
&& curwin->w_lcs_chars.leadmultispace != NULL)
|
&& curwin->w_lcs_chars.leadmultispace != NULL)
|
||||||
{
|
{
|
||||||
c = curwin->w_lcs_chars.leadmultispace[multispace_pos++];
|
c = curwin->w_lcs_chars.leadmultispace[multispace_pos++];
|
||||||
@@ -2082,7 +2085,7 @@ msg_prt_line(char_u *s, int list)
|
|||||||
c = curwin->w_lcs_chars.trail;
|
c = curwin->w_lcs_chars.trail;
|
||||||
attr = HL_ATTR(HLF_8);
|
attr = HL_ATTR(HLF_8);
|
||||||
}
|
}
|
||||||
else if (list && in_multispace
|
else if (in_multispace
|
||||||
&& curwin->w_lcs_chars.multispace != NULL)
|
&& curwin->w_lcs_chars.multispace != NULL)
|
||||||
{
|
{
|
||||||
c = curwin->w_lcs_chars.multispace[multispace_pos++];
|
c = curwin->w_lcs_chars.multispace[multispace_pos++];
|
||||||
|
@@ -4,6 +4,36 @@ source check.vim
|
|||||||
source view_util.vim
|
source view_util.vim
|
||||||
source screendump.vim
|
source screendump.vim
|
||||||
|
|
||||||
|
func Check_listchars(expected, end_lnum, end_scol = -1, leftcol = 0)
|
||||||
|
if a:leftcol > 0
|
||||||
|
let save_wrap = &wrap
|
||||||
|
set nowrap
|
||||||
|
call cursor(1, 1)
|
||||||
|
exe 'normal! ' .. a:leftcol .. 'zl'
|
||||||
|
endif
|
||||||
|
|
||||||
|
redraw!
|
||||||
|
for i in range(1, a:end_lnum)
|
||||||
|
if a:leftcol > 0
|
||||||
|
let col = virtcol2col(0, i, a:leftcol)
|
||||||
|
let col += getline(i)->strpart(col - 1, 1, v:true)->len()
|
||||||
|
call cursor(i, col)
|
||||||
|
redraw
|
||||||
|
call assert_equal(a:leftcol, winsaveview().leftcol)
|
||||||
|
else
|
||||||
|
call cursor(i, 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
let end_scol = a:end_scol < 0 ? '$'->virtcol() - a:leftcol : a:end_scol
|
||||||
|
call assert_equal([a:expected[i - 1]->strcharpart(a:leftcol)],
|
||||||
|
\ ScreenLines(i, end_scol))
|
||||||
|
endfor
|
||||||
|
|
||||||
|
if a:leftcol > 0
|
||||||
|
let &wrap = save_wrap
|
||||||
|
endif
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_listchars()
|
func Test_listchars()
|
||||||
enew!
|
enew!
|
||||||
set ff=unix
|
set ff=unix
|
||||||
@@ -24,11 +54,8 @@ func Test_listchars()
|
|||||||
\ 'dd........ee<<>-$',
|
\ 'dd........ee<<>-$',
|
||||||
\ '<$'
|
\ '<$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 5)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 4, -1, 5)
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, '$'->virtcol()))
|
|
||||||
endfor
|
|
||||||
|
|
||||||
set listchars-=trail:<
|
set listchars-=trail:<
|
||||||
let expected = [
|
let expected = [
|
||||||
@@ -38,11 +65,8 @@ func Test_listchars()
|
|||||||
\ 'dd........ee..>-$',
|
\ 'dd........ee..>-$',
|
||||||
\ '.$'
|
\ '.$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 5)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 4, -1, 5)
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
|
||||||
endfor
|
|
||||||
|
|
||||||
" tab with 3rd character.
|
" tab with 3rd character.
|
||||||
set listchars-=tab:>-
|
set listchars-=tab:>-
|
||||||
@@ -54,11 +78,8 @@ func Test_listchars()
|
|||||||
\ 'dd........ee--<>$',
|
\ 'dd........ee--<>$',
|
||||||
\ '-$'
|
\ '-$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 5)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 4, -1, 5)
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
|
||||||
endfor
|
|
||||||
|
|
||||||
" tab with 3rd character and linebreak set
|
" tab with 3rd character and linebreak set
|
||||||
set listchars-=tab:<=>
|
set listchars-=tab:<=>
|
||||||
@@ -71,11 +92,7 @@ func Test_listchars()
|
|||||||
\ 'dd........ee--<>$',
|
\ 'dd........ee--<>$',
|
||||||
\ '-$'
|
\ '-$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 5)
|
||||||
for i in range(1, 5)
|
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
|
||||||
endfor
|
|
||||||
set nolinebreak
|
set nolinebreak
|
||||||
set listchars-=tab:<·>
|
set listchars-=tab:<·>
|
||||||
set listchars+=tab:<=>
|
set listchars+=tab:<=>
|
||||||
@@ -88,11 +105,8 @@ func Test_listchars()
|
|||||||
\ 'dd........ee..<>$',
|
\ 'dd........ee..<>$',
|
||||||
\ '.$'
|
\ '.$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 5)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 4, -1, 5)
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
|
||||||
endfor
|
|
||||||
|
|
||||||
set listchars-=tab:<=>
|
set listchars-=tab:<=>
|
||||||
set listchars+=tab:>-
|
set listchars+=tab:>-
|
||||||
@@ -110,7 +124,8 @@ func Test_listchars()
|
|||||||
\ '..fff>--<<$',
|
\ '..fff>--<<$',
|
||||||
\ '>-------gg>-----$',
|
\ '>-------gg>-----$',
|
||||||
\ '.....h>-$',
|
\ '.....h>-$',
|
||||||
\ 'iii<<<<><<$', '$'], l)
|
\ 'iii<<<<><<$',
|
||||||
|
\ '$'], l)
|
||||||
|
|
||||||
" Test lead and trail
|
" Test lead and trail
|
||||||
normal ggdG
|
normal ggdG
|
||||||
@@ -134,12 +149,8 @@ func Test_listchars()
|
|||||||
\ '>>>>0xx0<<<<$',
|
\ '>>>>0xx0<<<<$',
|
||||||
\ '$'
|
\ '$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 6)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 5, -1, 6)
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
|
||||||
endfor
|
|
||||||
|
|
||||||
call assert_equal(expected, split(execute("%list"), "\n"))
|
call assert_equal(expected, split(execute("%list"), "\n"))
|
||||||
|
|
||||||
" Test multispace
|
" Test multispace
|
||||||
@@ -164,12 +175,8 @@ func Test_listchars()
|
|||||||
\ 'yYzZ0yY0yYzZ$',
|
\ 'yYzZ0yY0yYzZ$',
|
||||||
\ '$'
|
\ '$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 6)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 5, -1, 6)
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
|
||||||
endfor
|
|
||||||
|
|
||||||
call assert_equal(expected, split(execute("%list"), "\n"))
|
call assert_equal(expected, split(execute("%list"), "\n"))
|
||||||
|
|
||||||
" Test leadmultispace + multispace
|
" Test leadmultispace + multispace
|
||||||
@@ -194,13 +201,12 @@ func Test_listchars()
|
|||||||
\ '.-+*0yY0yYzZ$',
|
\ '.-+*0yY0yYzZ$',
|
||||||
\ '$'
|
\ '$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
|
||||||
call assert_equal('eol:$,multispace:yYzZ,nbsp:S,leadmultispace:.-+*', &listchars)
|
call assert_equal('eol:$,multispace:yYzZ,nbsp:S,leadmultispace:.-+*', &listchars)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 6)
|
||||||
call cursor(i, 1)
|
call Check_listchars(expected, 5, -1, 1)
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
call Check_listchars(expected, 5, -1, 2)
|
||||||
endfor
|
call Check_listchars(expected, 5, -1, 3)
|
||||||
|
call Check_listchars(expected, 5, -1, 6)
|
||||||
call assert_equal(expected, split(execute("%list"), "\n"))
|
call assert_equal(expected, split(execute("%list"), "\n"))
|
||||||
|
|
||||||
" Test leadmultispace without multispace
|
" Test leadmultispace without multispace
|
||||||
@@ -223,16 +229,14 @@ func Test_listchars()
|
|||||||
\ '+h>>>>>>>>>>$',
|
\ '+h>>>>>>>>>>$',
|
||||||
\ '.-+*.-+*.-j>$',
|
\ '.-+*.-+*.-j>$',
|
||||||
\ '.-+*0++0>>>>$',
|
\ '.-+*0++0>>>>$',
|
||||||
\ '$',
|
\ '$'
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
redraw!
|
|
||||||
call assert_equal('eol:$,nbsp:S,leadmultispace:.-+*,space:+,trail:>,eol:$', &listchars)
|
call assert_equal('eol:$,nbsp:S,leadmultispace:.-+*,space:+,trail:>,eol:$', &listchars)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 6)
|
||||||
call cursor(i, 1)
|
call Check_listchars(expected, 5, -1, 1)
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
call Check_listchars(expected, 5, -1, 2)
|
||||||
endfor
|
call Check_listchars(expected, 5, -1, 3)
|
||||||
|
call Check_listchars(expected, 5, -1, 6)
|
||||||
call assert_equal(expected, split(execute("%list"), "\n"))
|
call assert_equal(expected, split(execute("%list"), "\n"))
|
||||||
|
|
||||||
" Test leadmultispace only
|
" Test leadmultispace only
|
||||||
@@ -255,14 +259,10 @@ func Test_listchars()
|
|||||||
\ ' h ',
|
\ ' h ',
|
||||||
\ '.-+*.-+*.-j ',
|
\ '.-+*.-+*.-j ',
|
||||||
\ '.-+*0 0 ',
|
\ '.-+*0 0 ',
|
||||||
\ ' ',
|
\ ' '
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
|
||||||
call assert_equal('leadmultispace:.-+*', &listchars)
|
call assert_equal('leadmultispace:.-+*', &listchars)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 5, 12)
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, 12))
|
|
||||||
endfor
|
|
||||||
call assert_equal(expected, split(execute("%list"), "\n"))
|
call assert_equal(expected, split(execute("%list"), "\n"))
|
||||||
|
|
||||||
" Test leadmultispace and lead and space
|
" Test leadmultispace and lead and space
|
||||||
@@ -286,14 +286,14 @@ func Test_listchars()
|
|||||||
\ '<h----------$',
|
\ '<h----------$',
|
||||||
\ '.-+*.-+*.-j-$',
|
\ '.-+*.-+*.-j-$',
|
||||||
\ '.-+*0--0----$',
|
\ '.-+*0--0----$',
|
||||||
\ '$',
|
\ '$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
|
||||||
call assert_equal('eol:$,lead:<,space:-,leadmultispace:.-+*', &listchars)
|
call assert_equal('eol:$,lead:<,space:-,leadmultispace:.-+*', &listchars)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 6)
|
||||||
call cursor(i, 1)
|
call Check_listchars(expected, 5, -1, 1)
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
call Check_listchars(expected, 5, -1, 2)
|
||||||
endfor
|
call Check_listchars(expected, 5, -1, 3)
|
||||||
|
call Check_listchars(expected, 5, -1, 6)
|
||||||
call assert_equal(expected, split(execute("%list"), "\n"))
|
call assert_equal(expected, split(execute("%list"), "\n"))
|
||||||
|
|
||||||
" the last occurrence of 'multispace:' is used
|
" the last occurrence of 'multispace:' is used
|
||||||
@@ -309,13 +309,9 @@ func Test_listchars()
|
|||||||
\ 'XyYX0Xy0XyYX$',
|
\ 'XyYX0Xy0XyYX$',
|
||||||
\ '$'
|
\ '$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
|
||||||
call assert_equal('eol:$,multispace:yYzZ,space:x,multispace:XyY', &listchars)
|
call assert_equal('eol:$,multispace:yYzZ,space:x,multispace:XyY', &listchars)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 6)
|
||||||
call cursor(i, 1)
|
call Check_listchars(expected, 5, -1, 6)
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
|
||||||
endfor
|
|
||||||
|
|
||||||
call assert_equal(expected, split(execute("%list"), "\n"))
|
call assert_equal(expected, split(execute("%list"), "\n"))
|
||||||
|
|
||||||
set listchars+=lead:>,trail:<
|
set listchars+=lead:>,trail:<
|
||||||
@@ -328,12 +324,8 @@ func Test_listchars()
|
|||||||
\ '>>>>0Xy0<<<<$',
|
\ '>>>>0Xy0<<<<$',
|
||||||
\ '$'
|
\ '$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 6)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 5, -1, 6)
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
|
||||||
endfor
|
|
||||||
|
|
||||||
call assert_equal(expected, split(execute("%list"), "\n"))
|
call assert_equal(expected, split(execute("%list"), "\n"))
|
||||||
|
|
||||||
" removing 'multispace:'
|
" removing 'multispace:'
|
||||||
@@ -348,12 +340,8 @@ func Test_listchars()
|
|||||||
\ '>>>>0xx0<<<<$',
|
\ '>>>>0xx0<<<<$',
|
||||||
\ '$'
|
\ '$'
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 6)
|
||||||
for i in range(1, 5)
|
call Check_listchars(expected, 5, -1, 6)
|
||||||
call cursor(i, 1)
|
|
||||||
call assert_equal([expected[i - 1]], ScreenLines(i, virtcol('$')))
|
|
||||||
endfor
|
|
||||||
|
|
||||||
call assert_equal(expected, split(execute("%list"), "\n"))
|
call assert_equal(expected, split(execute("%list"), "\n"))
|
||||||
|
|
||||||
" test nbsp
|
" test nbsp
|
||||||
@@ -365,15 +353,10 @@ func Test_listchars()
|
|||||||
call append(0, [ ">" .. nbsp .. "<" ])
|
call append(0, [ ">" .. nbsp .. "<" ])
|
||||||
|
|
||||||
let expected = '>X< '
|
let expected = '>X< '
|
||||||
|
call Check_listchars([expected], 1)
|
||||||
redraw!
|
|
||||||
call cursor(1, 1)
|
|
||||||
call assert_equal([expected], ScreenLines(1, virtcol('$')))
|
|
||||||
|
|
||||||
set listchars=nbsp:X
|
set listchars=nbsp:X
|
||||||
redraw!
|
call Check_listchars([expected], 1)
|
||||||
call cursor(1, 1)
|
|
||||||
call assert_equal([expected], ScreenLines(1, virtcol('$')))
|
|
||||||
|
|
||||||
" test extends
|
" test extends
|
||||||
normal ggdG
|
normal ggdG
|
||||||
@@ -383,16 +366,11 @@ func Test_listchars()
|
|||||||
call append(0, [ repeat('A', &columns + 1) ])
|
call append(0, [ repeat('A', &columns + 1) ])
|
||||||
|
|
||||||
let expected = repeat('A', &columns)
|
let expected = repeat('A', &columns)
|
||||||
|
call Check_listchars([expected], 1, &columns)
|
||||||
redraw!
|
|
||||||
call cursor(1, 1)
|
|
||||||
call assert_equal([expected], ScreenLines(1, &columns))
|
|
||||||
|
|
||||||
set list
|
set list
|
||||||
let expected = expected[:-2] . 'Z'
|
let expected = expected[:-2] . 'Z'
|
||||||
redraw!
|
call Check_listchars([expected], 1, &columns)
|
||||||
call cursor(1, 1)
|
|
||||||
call assert_equal([expected], ScreenLines(1, &columns))
|
|
||||||
|
|
||||||
enew!
|
enew!
|
||||||
set listchars& ff&
|
set listchars& ff&
|
||||||
@@ -411,19 +389,20 @@ func Test_listchars_unicode()
|
|||||||
let nbsp = nr2char(0xa0)
|
let nbsp = nr2char(0xa0)
|
||||||
call append(0, [" a\tb c" .. nbsp .. "d "])
|
call append(0, [" a\tb c" .. nbsp .. "d "])
|
||||||
let expected = ['≡≢≣≡≢≣≡≢a←↔↔↔↔↔→b␣c≠d≡≢⇔']
|
let expected = ['≡≢≣≡≢≣≡≢a←↔↔↔↔↔→b␣c≠d≡≢⇔']
|
||||||
redraw!
|
call Check_listchars(expected, 1)
|
||||||
call cursor(1, 1)
|
call Check_listchars(expected, 1, -1, 3)
|
||||||
call assert_equal(expected, ScreenLines(1, virtcol('$')))
|
call Check_listchars(expected, 1, -1, 13)
|
||||||
|
|
||||||
set listchars=eol:\\u21d4,space:\\u2423,multispace:≡\\u2262\\U00002263,nbsp:\\U00002260,tab:←↔\\u2192
|
set listchars=eol:\\u21d4,space:\\u2423,multispace:≡\\u2262\\U00002263,nbsp:\\U00002260,tab:←↔\\u2192
|
||||||
redraw!
|
call Check_listchars(expected, 1)
|
||||||
call assert_equal(expected, ScreenLines(1, virtcol('$')))
|
call Check_listchars(expected, 1, -1, 3)
|
||||||
|
call Check_listchars(expected, 1, -1, 13)
|
||||||
|
|
||||||
set listchars+=lead:⇨,trail:⇦
|
set listchars+=lead:⇨,trail:⇦
|
||||||
let expected = ['⇨⇨⇨⇨⇨⇨⇨⇨a←↔↔↔↔↔→b␣c≠d⇦⇦⇔']
|
let expected = ['⇨⇨⇨⇨⇨⇨⇨⇨a←↔↔↔↔↔→b␣c≠d⇦⇦⇔']
|
||||||
redraw!
|
call Check_listchars(expected, 1)
|
||||||
call cursor(1, 1)
|
call Check_listchars(expected, 1, -1, 3)
|
||||||
call assert_equal(expected, ScreenLines(1, virtcol('$')))
|
call Check_listchars(expected, 1, -1, 13)
|
||||||
|
|
||||||
let &encoding=oldencoding
|
let &encoding=oldencoding
|
||||||
enew!
|
enew!
|
||||||
@@ -515,9 +494,7 @@ func Test_listchars_composing()
|
|||||||
let expected = [
|
let expected = [
|
||||||
\ "_ \u3099^I \u309A=" .. nbsp1 .. "\u0302=" .. nbsp2 .. "\u0302$"
|
\ "_ \u3099^I \u309A=" .. nbsp1 .. "\u0302=" .. nbsp2 .. "\u0302$"
|
||||||
\ ]
|
\ ]
|
||||||
redraw!
|
call Check_listchars(expected, 1)
|
||||||
call cursor(1, 1)
|
|
||||||
call assert_equal(expected, ScreenLines(1, virtcol('$')))
|
|
||||||
let &encoding=oldencoding
|
let &encoding=oldencoding
|
||||||
enew!
|
enew!
|
||||||
set listchars& ff&
|
set listchars& ff&
|
||||||
|
@@ -699,6 +699,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 */
|
||||||
|
/**/
|
||||||
|
1938,
|
||||||
/**/
|
/**/
|
||||||
1937,
|
1937,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user