mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
8872fce120
commit
0c9888cdbe
@ -1595,15 +1595,16 @@ void ex_file(exarg_T *eap)
|
||||
}
|
||||
|
||||
if (*eap->arg != NUL || eap->addr_count == 1) {
|
||||
if (rename_buffer(eap->arg) == FAIL)
|
||||
if (rename_buffer(eap->arg) == FAIL) {
|
||||
return;
|
||||
}
|
||||
redraw_tabline = true;
|
||||
}
|
||||
|
||||
if (!shortmess(SHM_FILEINFO)) {
|
||||
// print full file name if :cd used
|
||||
// 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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -339,3 +339,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
|
||||
|
Loading…
Reference in New Issue
Block a user