mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 14:58:18 +00:00
vim-patch:8.1.1334: respect shortmess=F when buffer is hidden #11443
Problem: When buffer is hidden "F" in 'shortmess' is not used.
Solution: Check the "F" flag in 'shortmess' when the buffer is already
loaded. (Jason Franklin) Add test_getvalue() to be able to test
this.
eda652215a
test_getvalue() is not implemented.
It is only used for checking "need_fileinfo" internal variable.
This commit is contained in:

committed by
Justin M. Keyes

parent
2aa7b10114
commit
222637c341
@@ -1585,10 +1585,12 @@ void enter_buffer(buf_T *buf)
|
|||||||
|
|
||||||
open_buffer(false, NULL, 0);
|
open_buffer(false, NULL, 0);
|
||||||
} else {
|
} else {
|
||||||
if (!msg_silent) {
|
if (!msg_silent && !shortmess(SHM_FILEINFO)) {
|
||||||
need_fileinfo = true; // display file info after redraw
|
need_fileinfo = true; // display file info after redraw
|
||||||
}
|
}
|
||||||
(void)buf_check_timestamp(curbuf, false); // check if file changed
|
// check if file changed
|
||||||
|
(void)buf_check_timestamp(curbuf, false);
|
||||||
|
|
||||||
curwin->w_topline = 1;
|
curwin->w_topline = 1;
|
||||||
curwin->w_topfill = 0;
|
curwin->w_topfill = 0;
|
||||||
apply_autocmds(EVENT_BUFENTER, NULL, NULL, false, curbuf);
|
apply_autocmds(EVENT_BUFENTER, NULL, NULL, false, curbuf);
|
||||||
|
@@ -476,13 +476,19 @@ func Test_shortmess_F2()
|
|||||||
call assert_match('file2', execute('bn', ''))
|
call assert_match('file2', execute('bn', ''))
|
||||||
set shortmess+=F
|
set shortmess+=F
|
||||||
call assert_true(empty(execute('bn', '')))
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
" call assert_false(test_getvalue('need_fileinfo'))
|
||||||
call assert_true(empty(execute('bn', '')))
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
" call assert_false(test_getvalue('need_fileinfo'))
|
||||||
set hidden
|
set hidden
|
||||||
call assert_true(empty(execute('bn', '')))
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
" call assert_false(test_getvalue('need_fileinfo'))
|
||||||
call assert_true(empty(execute('bn', '')))
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
" call assert_false(test_getvalue('need_fileinfo'))
|
||||||
set nohidden
|
set nohidden
|
||||||
call assert_true(empty(execute('bn', '')))
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
" call assert_false(test_getvalue('need_fileinfo'))
|
||||||
call assert_true(empty(execute('bn', '')))
|
call assert_true(empty(execute('bn', '')))
|
||||||
|
" call assert_false(test_getvalue('need_fileinfo'))
|
||||||
" Accommodate Nvim default.
|
" Accommodate Nvim default.
|
||||||
set shortmess-=F
|
set shortmess-=F
|
||||||
call assert_match('file1', execute('bn', ''))
|
call assert_match('file1', execute('bn', ''))
|
||||||
|
Reference in New Issue
Block a user