diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-11-24 00:56:58 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-11-23 21:56:58 -0800 |
commit | 222637c341700294a059651bcea62d2e91795646 (patch) | |
tree | 42564f2f8e82811822e1bda71ee1c71f0cd4da62 | |
parent | 2aa7b101142e4b66682ba40b43537d8f2192f0a3 (diff) | |
download | rneovim-222637c341700294a059651bcea62d2e91795646.tar.gz rneovim-222637c341700294a059651bcea62d2e91795646.tar.bz2 rneovim-222637c341700294a059651bcea62d2e91795646.zip |
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.
https://github.com/vim/vim/commit/eda652215abf696f86b872888945a2d2dd8c7192
test_getvalue() is not implemented.
It is only used for checking "need_fileinfo" internal variable.
-rw-r--r-- | src/nvim/buffer.c | 6 | ||||
-rw-r--r-- | src/nvim/testdir/test_options.vim | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 1244b8502c..0cd02ce36b 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1585,10 +1585,12 @@ void enter_buffer(buf_T *buf) open_buffer(false, NULL, 0); } else { - if (!msg_silent) { + if (!msg_silent && !shortmess(SHM_FILEINFO)) { 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_topfill = 0; apply_autocmds(EVENT_BUFENTER, NULL, NULL, false, curbuf); diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index f4f5cbca61..6fcc372591 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -476,13 +476,19 @@ func Test_shortmess_F2() call assert_match('file2', execute('bn', '')) set shortmess+=F call assert_true(empty(execute('bn', ''))) + " call assert_false(test_getvalue('need_fileinfo')) call assert_true(empty(execute('bn', ''))) + " call assert_false(test_getvalue('need_fileinfo')) set hidden call assert_true(empty(execute('bn', ''))) + " call assert_false(test_getvalue('need_fileinfo')) call assert_true(empty(execute('bn', ''))) + " call assert_false(test_getvalue('need_fileinfo')) set nohidden call assert_true(empty(execute('bn', ''))) + " call assert_false(test_getvalue('need_fileinfo')) call assert_true(empty(execute('bn', ''))) + " call assert_false(test_getvalue('need_fileinfo')) " Accommodate Nvim default. set shortmess-=F call assert_match('file1', execute('bn', '')) |