forked from aniani/vim
patch 8.1.0969: message written during startup is truncated
Problem: Message written during startup is truncated. Solution: Restore message after truncating. (closes 3969)
This commit is contained in:
@@ -2627,12 +2627,19 @@ msg_puts_printf(char_u *str, int maxlen)
|
||||
|
||||
if (*p != NUL && !(silent_mode && p_verbose == 0))
|
||||
{
|
||||
int c = -1;
|
||||
|
||||
if (maxlen > 0 && STRLEN(p) > (size_t)maxlen)
|
||||
{
|
||||
c = p[maxlen];
|
||||
p[maxlen] = 0;
|
||||
}
|
||||
if (info_message)
|
||||
mch_msg((char *)p);
|
||||
else
|
||||
mch_errmsg((char *)p);
|
||||
if (c != -1)
|
||||
p[maxlen] = c;
|
||||
}
|
||||
|
||||
msg_didout = TRUE; // assume that line is not empty
|
||||
|
@@ -537,3 +537,13 @@ func Test_zzz_startinsert()
|
||||
endif
|
||||
call delete('Xtestout')
|
||||
endfunc
|
||||
|
||||
func Test_issue_3969()
|
||||
if has('gui_running')
|
||||
" Can't catch the output of gvim.
|
||||
return
|
||||
endif
|
||||
" Check that message is not truncated.
|
||||
let out = system(GetVimCommand() . ' -es -X -V1 -c "echon ''hello''" -cq')
|
||||
call assert_equal('hello', out)
|
||||
endfunc
|
||||
|
@@ -779,6 +779,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
969,
|
||||
/**/
|
||||
968,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user