vim-patch:8.1.0110: file name not displayed with ":file" (#8878)

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 vim/vim#3070)
fc0896093c

closes #8817
closes #8873
This commit is contained in:
Justin M. Keyes 2018-08-21 09:25:48 +02:00 committed by GitHub
parent 8872fce120
commit 0c9888cdbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 4 deletions

View File

@ -1595,15 +1595,16 @@ void ex_file(exarg_T *eap)
} }
if (*eap->arg != NUL || eap->addr_count == 1) { if (*eap->arg != NUL || eap->addr_count == 1) {
if (rename_buffer(eap->arg) == FAIL) if (rename_buffer(eap->arg) == FAIL) {
return; return;
}
redraw_tabline = true;
} }
if (!shortmess(SHM_FILEINFO)) { // print file name if no argument or 'F' is not in 'shortmess'
// print full file name if :cd used if (*eap->arg == NUL || !shortmess(SHM_FILEINFO)) {
fileinfo(false, false, eap->forceit); fileinfo(false, false, eap->forceit);
} }
redraw_tabline = true;
} }
/* /*

View File

@ -339,3 +339,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