mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #16705 from zeertzjq/vim-8.2.2508
vim-patch:8.2.{2508,2641,3846}
This commit is contained in:
commit
397201f2c6
@ -116,10 +116,12 @@ other windows. If 'mouse' is enabled, a status line can be dragged to resize
|
|||||||
windows.
|
windows.
|
||||||
|
|
||||||
*filler-lines*
|
*filler-lines*
|
||||||
The lines after the last buffer line in a window are called filler lines.
|
The lines after the last buffer line in a window are called filler lines. By
|
||||||
These lines start with a tilde (~) character. By default, these are
|
default, these lines start with a tilde (~) character. The 'eob' item in the
|
||||||
highlighted as NonText (|hl-NonText|). The EndOfBuffer highlight group
|
'fillchars' option can be used to change this character. By default, these
|
||||||
(|hl-EndOfBuffer|) can be used to change the highlighting of filler lines.
|
characters are highlighted as NonText (|hl-NonText|). The EndOfBuffer
|
||||||
|
highlight group (|hl-EndOfBuffer|) can be used to change the highlighting of
|
||||||
|
the filler characters.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
3. Opening and closing a window *opening-window* *E36*
|
3. Opening and closing a window *opening-window* *E36*
|
||||||
|
@ -3613,7 +3613,7 @@ static char *set_chars_option(win_T *wp, char_u **varp, bool set)
|
|||||||
c2 = c3 = 0;
|
c2 = c3 = 0;
|
||||||
s = p + len + 1;
|
s = p + len + 1;
|
||||||
c1 = get_encoded_char_adv(&s);
|
c1 = get_encoded_char_adv(&s);
|
||||||
if (c1 == 0 || utf_char2cells(c1) > 1) {
|
if (c1 == 0 || char2cells(c1) > 1) {
|
||||||
return e_invarg;
|
return e_invarg;
|
||||||
}
|
}
|
||||||
if (tab[i].cp == &wp->w_p_lcs_chars.tab2) {
|
if (tab[i].cp == &wp->w_p_lcs_chars.tab2) {
|
||||||
@ -3621,12 +3621,12 @@ static char *set_chars_option(win_T *wp, char_u **varp, bool set)
|
|||||||
return e_invarg;
|
return e_invarg;
|
||||||
}
|
}
|
||||||
c2 = get_encoded_char_adv(&s);
|
c2 = get_encoded_char_adv(&s);
|
||||||
if (c2 == 0 || utf_char2cells(c2) > 1) {
|
if (c2 == 0 || char2cells(c2) > 1) {
|
||||||
return e_invarg;
|
return e_invarg;
|
||||||
}
|
}
|
||||||
if (!(*s == ',' || *s == NUL)) {
|
if (!(*s == ',' || *s == NUL)) {
|
||||||
c3 = get_encoded_char_adv(&s);
|
c3 = get_encoded_char_adv(&s);
|
||||||
if (c3 == 0 || utf_char2cells(c3) > 1) {
|
if (c3 == 0 || char2cells(c3) > 1) {
|
||||||
return e_invarg;
|
return e_invarg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3660,7 +3660,7 @@ static char *set_chars_option(win_T *wp, char_u **varp, bool set)
|
|||||||
multispace_len = 0;
|
multispace_len = 0;
|
||||||
while (*s != NUL && *s != ',') {
|
while (*s != NUL && *s != ',') {
|
||||||
c1 = get_encoded_char_adv(&s);
|
c1 = get_encoded_char_adv(&s);
|
||||||
if (c1 == 0 || utf_char2cells(c1) > 1) {
|
if (c1 == 0 || char2cells(c1) > 1) {
|
||||||
return e_invarg;
|
return e_invarg;
|
||||||
}
|
}
|
||||||
multispace_len++;
|
multispace_len++;
|
||||||
|
@ -263,6 +263,31 @@ func Test_display_scroll_at_topline()
|
|||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test for 'eob' (EndOfBuffer) item in 'fillchars'
|
||||||
|
func Test_eob_fillchars()
|
||||||
|
" default value (skipped)
|
||||||
|
" call assert_match('eob:\~', &fillchars)
|
||||||
|
" invalid values
|
||||||
|
call assert_fails(':set fillchars=eob:', 'E474:')
|
||||||
|
call assert_fails(':set fillchars=eob:xy', 'E474:')
|
||||||
|
call assert_fails(':set fillchars=eob:\255', 'E474:')
|
||||||
|
call assert_fails(':set fillchars=eob:<ff>', 'E474:')
|
||||||
|
call assert_fails(":set fillchars=eob:\x01", 'E474:')
|
||||||
|
call assert_fails(':set fillchars=eob:\\x01', 'E474:')
|
||||||
|
" default is ~
|
||||||
|
new
|
||||||
|
redraw
|
||||||
|
call assert_equal('~', Screenline(2))
|
||||||
|
set fillchars=eob:+
|
||||||
|
redraw
|
||||||
|
call assert_equal('+', Screenline(2))
|
||||||
|
set fillchars=eob:\
|
||||||
|
redraw
|
||||||
|
call assert_equal(' ', nr2char(screenchar(2, 1)))
|
||||||
|
set fillchars&
|
||||||
|
close
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_display_linebreak_breakat()
|
func Test_display_linebreak_breakat()
|
||||||
new
|
new
|
||||||
vert resize 25
|
vert resize 25
|
||||||
|
@ -331,7 +331,7 @@ func Test_listchars_invalid()
|
|||||||
call assert_fails('set listchars=space:xx', 'E474:')
|
call assert_fails('set listchars=space:xx', 'E474:')
|
||||||
call assert_fails('set listchars=tab:xxxx', 'E474:')
|
call assert_fails('set listchars=tab:xxxx', 'E474:')
|
||||||
|
|
||||||
" Has non-single width character
|
" Has double-width character
|
||||||
call assert_fails('set listchars=space:·', 'E474:')
|
call assert_fails('set listchars=space:·', 'E474:')
|
||||||
call assert_fails('set listchars=tab:·x', 'E474:')
|
call assert_fails('set listchars=tab:·x', 'E474:')
|
||||||
call assert_fails('set listchars=tab:x·', 'E474:')
|
call assert_fails('set listchars=tab:x·', 'E474:')
|
||||||
@ -339,6 +339,20 @@ func Test_listchars_invalid()
|
|||||||
call assert_fails('set listchars=multispace:·', 'E474:')
|
call assert_fails('set listchars=multispace:·', 'E474:')
|
||||||
call assert_fails('set listchars=multispace:xxx·', 'E474:')
|
call assert_fails('set listchars=multispace:xxx·', 'E474:')
|
||||||
|
|
||||||
|
" Has control character
|
||||||
|
call assert_fails("set listchars=space:\x01", 'E474:')
|
||||||
|
call assert_fails("set listchars=tab:\x01x", 'E474:')
|
||||||
|
call assert_fails("set listchars=tab:x\x01", 'E474:')
|
||||||
|
call assert_fails("set listchars=tab:xx\x01", 'E474:')
|
||||||
|
call assert_fails("set listchars=multispace:\x01", 'E474:')
|
||||||
|
call assert_fails("set listchars=multispace:xxx\x01", 'E474:')
|
||||||
|
call assert_fails('set listchars=space:\\x01', 'E474:')
|
||||||
|
call assert_fails('set listchars=tab:\\x01x', 'E474:')
|
||||||
|
call assert_fails('set listchars=tab:x\\x01', 'E474:')
|
||||||
|
call assert_fails('set listchars=tab:xx\\x01', 'E474:')
|
||||||
|
call assert_fails('set listchars=multispace:\\x01', 'E474:')
|
||||||
|
call assert_fails('set listchars=multispace:xxx\\x01', 'E474:')
|
||||||
|
|
||||||
enew!
|
enew!
|
||||||
set ambiwidth& listchars& ff&
|
set ambiwidth& listchars& ff&
|
||||||
endfunction
|
endfunction
|
||||||
|
Loading…
Reference in New Issue
Block a user