mirror of
https://github.com/vim/vim.git
synced 2025-07-25 10:54:51 -04:00
patch 8.1.0310: file info msg not always suppressed with 'F' in 'shortmess'
Problem: File info message not always suppressed with 'F' in 'shortmess'. (Asheq Imran) Solution: Save and restore msg_silent. (Christian Brabandt, closes #3221)
This commit is contained in:
parent
7feb35e778
commit
2f0f871159
@ -1035,7 +1035,14 @@ handle_swap_exists(bufref_T *old_curbuf)
|
|||||||
buf = old_curbuf->br_buf;
|
buf = old_curbuf->br_buf;
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
{
|
{
|
||||||
|
int old_msg_silent = msg_silent;
|
||||||
|
|
||||||
|
if (shortmess(SHM_FILEINFO))
|
||||||
|
msg_silent = 1; // prevent fileinfo message
|
||||||
enter_buffer(buf);
|
enter_buffer(buf);
|
||||||
|
// restore msg_silent, so that the command line will be shown
|
||||||
|
msg_silent = old_msg_silent;
|
||||||
|
|
||||||
# ifdef FEAT_SYN_HL
|
# ifdef FEAT_SYN_HL
|
||||||
if (old_tw != curbuf->b_p_tw)
|
if (old_tw != curbuf->b_p_tw)
|
||||||
check_colorcolumn(curwin);
|
check_colorcolumn(curwin);
|
||||||
|
@ -828,10 +828,13 @@ ml_open_file(buf_T *buf)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
check_need_swap(
|
check_need_swap(
|
||||||
int newfile) /* reading file into new buffer */
|
int newfile) // reading file into new buffer
|
||||||
{
|
{
|
||||||
|
int old_msg_silent = msg_silent; // might be reset by an E325 message
|
||||||
|
|
||||||
if (curbuf->b_may_swap && (!curbuf->b_p_ro || !newfile))
|
if (curbuf->b_may_swap && (!curbuf->b_p_ro || !newfile))
|
||||||
ml_open_file(curbuf);
|
ml_open_file(curbuf);
|
||||||
|
msg_silent = old_msg_silent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -414,3 +414,24 @@ func Test_shortmess_F()
|
|||||||
set shortmess&
|
set shortmess&
|
||||||
bwipe
|
bwipe
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_shortmess_F2()
|
||||||
|
e file1
|
||||||
|
e file2
|
||||||
|
call assert_match('file1', execute('bn', ''))
|
||||||
|
call assert_match('file2', execute('bn', ''))
|
||||||
|
set shortmess+=F
|
||||||
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
set hidden
|
||||||
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
set nohidden
|
||||||
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
set shortmess&
|
||||||
|
call assert_match('file1', execute('bn', ''))
|
||||||
|
call assert_match('file2', execute('bn', ''))
|
||||||
|
bwipe
|
||||||
|
bwipe
|
||||||
|
endfunc
|
||||||
|
@ -794,6 +794,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
310,
|
||||||
/**/
|
/**/
|
||||||
309,
|
309,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user