diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2017-03-22 02:13:54 +0100 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2017-03-22 18:43:01 +0100 |
| commit | 54f31187ba006049ba455a1eeea4781750a3958d (patch) | |
| tree | f28cdea12aee71a5b0394ca2a98d6b5e6c702a0e /src/nvim/testdir | |
| parent | f58a593cea3872c7b8b862375b6982436ee88ef2 (diff) | |
| download | rneovim-54f31187ba006049ba455a1eeea4781750a3958d.tar.gz rneovim-54f31187ba006049ba455a1eeea4781750a3958d.tar.bz2 rneovim-54f31187ba006049ba455a1eeea4781750a3958d.zip | |
vim-patch:8.0.0482
Problem: The setbufvar() function may mess up the window layout. (Kay Z.)
Solution: Do not check the window to be valid if it is NULL.
https://github.com/vim/vim/commit/2c90d51123fba44a90e09aa4a4f2b7d972dadb94
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_functions.vim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim new file mode 100644 index 0000000000..81cb6314ce --- /dev/null +++ b/src/nvim/testdir/test_functions.vim @@ -0,0 +1,31 @@ +func Test_setbufvar_options() + " This tests that aucmd_prepbuf() and aucmd_restbuf() properly restore the + " window layout. + call assert_equal(1, winnr('$')) + split dummy_preview + resize 2 + set winfixheight winfixwidth + let prev_id = win_getid() + + wincmd j + let wh = winheight('.') + let dummy_buf = bufnr('dummy_buf1', v:true) + call setbufvar(dummy_buf, '&buftype', 'nofile') + execute 'belowright vertical split #' . dummy_buf + call assert_equal(wh, winheight('.')) + let dum1_id = win_getid() + + wincmd h + let wh = winheight('.') + let dummy_buf = bufnr('dummy_buf2', v:true) + call setbufvar(dummy_buf, '&buftype', 'nofile') + execute 'belowright vertical split #' . dummy_buf + call assert_equal(wh, winheight('.')) + + bwipe! + call win_gotoid(prev_id) + bwipe! + call win_gotoid(dum1_id) + bwipe! +endfunc + |