Skip to content

Commit fc08960

Browse files
committed
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)
1 parent 7cb6eec commit fc08960

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

src/ex_cmds.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3094,11 +3094,12 @@ ex_file(exarg_T *eap)
30943094
{
30953095
if (rename_buffer(eap->arg) == FAIL)
30963096
return;
3097+
redraw_tabline = TRUE;
30973098
}
3098-
/* print full file name if :cd used */
3099-
if (!shortmess(SHM_FILEINFO))
3099+
3100+
// print file name if no argument or 'F' is not in 'shortmess'
3101+
if (*eap->arg == NUL || !shortmess(SHM_FILEINFO))
31003102
fileinfo(FALSE, FALSE, eap->forceit);
3101-
redraw_tabline = TRUE;
31023103
}
31033104

31043105
/*

src/testdir/test_options.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,3 +400,17 @@ func Test_copy_winopt()
400400
call assert_equal(4,&numberwidth)
401401
bw!
402402
endfunc
403+
404+
func Test_shortmess_F()
405+
new
406+
call assert_match('\[No Name\]', execute('file'))
407+
set shortmess+=F
408+
call assert_match('\[No Name\]', execute('file'))
409+
call assert_match('^\s*$', execute('file foo'))
410+
call assert_match('foo', execute('file'))
411+
set shortmess-=F
412+
call assert_match('bar', execute('file bar'))
413+
call assert_match('bar', execute('file'))
414+
set shortmess&
415+
bwipe
416+
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,8 @@ static char *(features[]) =
789789

790790
static int included_patches[] =
791791
{ /* Add new patch number below this line */
792+
/**/
793+
110,
792794
/**/
793795
109,
794796
/**/

0 commit comments

Comments
 (0)