1
0
forked from aniani/vim

patch 8.1.0110: file name not displayed with ":file"

Problem:    File name not displayed with ":file" when 'F' is in 'shortmess'.
Solution:   Always display the file name when there is no argument (Christian
            Brabandt, closes #3070)
This commit is contained in:
Bram Moolenaar
2018-06-24 16:53:35 +02:00
parent 7cb6eecd32
commit fc0896093c
3 changed files with 20 additions and 3 deletions

View File

@@ -3094,11 +3094,12 @@ ex_file(exarg_T *eap)
{ {
if (rename_buffer(eap->arg) == FAIL) if (rename_buffer(eap->arg) == FAIL)
return; return;
}
/* print full file name if :cd used */
if (!shortmess(SHM_FILEINFO))
fileinfo(FALSE, FALSE, eap->forceit);
redraw_tabline = TRUE; redraw_tabline = TRUE;
}
// print file name if no argument or 'F' is not in 'shortmess'
if (*eap->arg == NUL || !shortmess(SHM_FILEINFO))
fileinfo(FALSE, FALSE, eap->forceit);
} }
/* /*

View File

@@ -400,3 +400,17 @@ func Test_copy_winopt()
call assert_equal(4,&numberwidth) call assert_equal(4,&numberwidth)
bw! bw!
endfunc endfunc
func Test_shortmess_F()
new
call assert_match('\[No Name\]', execute('file'))
set shortmess+=F
call assert_match('\[No Name\]', execute('file'))
call assert_match('^\s*$', execute('file foo'))
call assert_match('foo', execute('file'))
set shortmess-=F
call assert_match('bar', execute('file bar'))
call assert_match('bar', execute('file'))
set shortmess&
bwipe
endfunc

View File

@@ -789,6 +789,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 */
/**/
110,
/**/ /**/
109, 109,
/**/ /**/