diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-05-13 18:05:33 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-05-13 18:05:33 +0200 |
commit | 25782a7ff4755daf16c2e1cb5e5f826b13b672ce (patch) | |
tree | 7c8842590d4759e55af0424ebabc2852df5c0574 /src/testdir/test_options.vim | |
parent | 2290b1f8aaafbcb38bd801d08e8bf86cb07abfa5 (diff) | |
download | vim-git-25782a7ff4755daf16c2e1cb5e5f826b13b672ce.tar.gz |
patch 8.0.1836: buffer-local window options may not be recentv8.0.1836
Problem: Buffer-local window options may not be recent if the buffer is
still open in another window.
Solution: Copy the options from the window instead of the outdated window
options. (Bjorn Linse, closes #2336)
Diffstat (limited to 'src/testdir/test_options.vim')
-rw-r--r-- | src/testdir/test_options.vim | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim index 8fa5f8b7b..167cb1ce0 100644 --- a/src/testdir/test_options.vim +++ b/src/testdir/test_options.vim @@ -348,3 +348,55 @@ func Test_backupskip() endif endfor endfunc + +func Test_copy_winopt() + set hidden + + " Test copy option from current buffer in window + split + enew + setlocal numberwidth=5 + wincmd w + call assert_equal(4,&numberwidth) + bnext + call assert_equal(5,&numberwidth) + bw! + call assert_equal(4,&numberwidth) + + " Test copy value from window that used to be display the buffer + split + enew + setlocal numberwidth=6 + bnext + wincmd w + call assert_equal(4,&numberwidth) + bnext + call assert_equal(6,&numberwidth) + bw! + + " Test that if buffer is current, don't use the stale cached value + " from the last time the buffer was displayed. + split + enew + setlocal numberwidth=7 + bnext + bnext + setlocal numberwidth=8 + wincmd w + call assert_equal(4,&numberwidth) + bnext + call assert_equal(8,&numberwidth) + bw! + + " Test value is not copied if window already has seen the buffer + enew + split + setlocal numberwidth=9 + bnext + setlocal numberwidth=10 + wincmd w + call assert_equal(4,&numberwidth) + bnext + call assert_equal(4,&numberwidth) + bw! +endfunc |