Skip to content

Commit

Permalink
patch 8.1.0110: file name not displayed with ":file"
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
brammool committed Jun 24, 2018
1 parent 7cb6eec commit fc08960
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ex_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -3094,11 +3094,12 @@ ex_file(exarg_T *eap)
{
if (rename_buffer(eap->arg) == FAIL)
return;
redraw_tabline = TRUE;
}
/* print full file name if :cd used */
if (!shortmess(SHM_FILEINFO))

// 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;
}

/*
Expand Down
14 changes: 14 additions & 0 deletions src/testdir/test_options.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
110,
/**/
109,
/**/
Expand Down

0 comments on commit fc08960

Please sign in to comment.