# HG changeset patch # User Christian Brabandt # Date 1529852406 -7200 # Node ID 20468fb49f9b331b506f609f9750a05bcd41cc6e # Parent 97d8e543b55012ca27cc53bad4bec9f94b5ffb00 patch 8.1.0110: file name not displayed with ":file" commit https://github.com/vim/vim/commit/fc0896093c3b3e753859a5f929921933e7a2e6cd Author: Bram Moolenaar Date: Sun Jun 24 16:53:35 2018 +0200 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) diff --git a/src/ex_cmds.c b/src/ex_cmds.c --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -3094,11 +3094,12 @@ ex_file(exarg_T *eap) { if (rename_buffer(eap->arg) == FAIL) return; - } - /* print full file name if :cd used */ - if (!shortmess(SHM_FILEINFO)) + 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); - redraw_tabline = TRUE; } /* diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -400,3 +400,17 @@ func Test_copy_winopt() call assert_equal(4,&numberwidth) bw! 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -790,6 +790,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 110, +/**/ 109, /**/ 108,