0
0
mirror of https://github.com/vim/vim.git synced 2025-10-04 05:25:06 -04:00

patch 8.2.2508: cannot change the character displayed in non existing lines

Problem:    Cannot change the character displayed in non existing lines.
Solution:   Add the "eob" item to 'fillchars'. (closes #7832, closes #3820)
This commit is contained in:
Bram Moolenaar
2021-02-13 18:24:23 +01:00
parent 942db23c9c
commit a98f8a2305
9 changed files with 41 additions and 10 deletions

View File

@@ -2552,11 +2552,11 @@ win_update(win_T *wp)
wp->w_botline = lnum;
// Make sure the rest of the screen is blank
// put '~'s on rows that aren't part of the file.
// write the 'fill_eob' character to rows that aren't part of the file
if (WIN_IS_POPUP(wp))
win_draw_end(wp, ' ', ' ', FALSE, row, wp->w_height, HLF_AT);
else
win_draw_end(wp, '~', ' ', FALSE, row, wp->w_height, HLF_EOB);
win_draw_end(wp, fill_eob, ' ', FALSE, row, wp->w_height, HLF_EOB);
}
#ifdef SYN_TIME_LIMIT

View File

@@ -1363,6 +1363,7 @@ EXTERN int fill_stlnc INIT(= ' ');
EXTERN int fill_vert INIT(= ' ');
EXTERN int fill_fold INIT(= '-');
EXTERN int fill_diff INIT(= '-');
EXTERN int fill_eob INIT(= '~');
#ifdef FEAT_FOLDING
EXTERN int disable_fold_update INIT(= 0);

View File

@@ -952,7 +952,7 @@ static struct vimoption options[] =
SCTX_INIT},
{"fillchars", "fcs", P_STRING|P_VI_DEF|P_RALL|P_ONECOMMA|P_NODUP,
(char_u *)&p_fcs, PV_NONE,
{(char_u *)"vert:|,fold:-", (char_u *)0L}
{(char_u *)"vert:|,fold:-,eob:~", (char_u *)0L}
SCTX_INIT},
{"fixendofline", "fixeol", P_BOOL|P_VI_DEF|P_RSTAT,
(char_u *)&p_fixeol, PV_FIXEOL,

View File

@@ -4765,6 +4765,7 @@ set_chars_option(char_u **varp)
{&fill_vert, "vert"},
{&fill_fold, "fold"},
{&fill_diff, "diff"},
{&fill_eob, "eob"},
};
static struct charstab lcstab[] =
{
@@ -4812,7 +4813,10 @@ set_chars_option(char_u **varp)
lcs_tab3 = NUL;
}
else
{
fill_diff = '-';
fill_eob = '~';
}
}
p = *varp;
while (*p)

View File

@@ -257,4 +257,26 @@ func Test_display_scroll_at_topline()
call StopVimInTerminal(buf)
endfunc
" Test for 'eob' (EndOfBuffer) item in 'fillchars'
func Test_eob_fillchars()
" default value
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:')
" default is ~
new
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
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2508,
/**/
2507,
/**/