aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-06-22 09:53:46 +0200
committerGitHub <noreply@github.com>2018-06-22 09:53:46 +0200
commitbf2460e2f980697be54090bdaa6b1bdc618b3791 (patch)
tree9997df764fabad0f60b2aaf81f5935a3f702ff60 /src/nvim/testdir
parente1c6109e62b4e1d12ebdab67140f82cc7dc2c0d1 (diff)
parent8917e0c3010f93d6238bda21c4807c6c5921eb4a (diff)
downloadrneovim-bf2460e2f980697be54090bdaa6b1bdc618b3791.tar.gz
rneovim-bf2460e2f980697be54090bdaa6b1bdc618b3791.tar.bz2
rneovim-bf2460e2f980697be54090bdaa6b1bdc618b3791.zip
Merge pull request #7551 from bfredl/setl_bufwin
fix copying setl options for buffer currently displayed in another window
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_options.vim52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim
index d9cd5fd583..f0aec42ae1 100644
--- a/src/nvim/testdir/test_options.vim
+++ b/src/nvim/testdir/test_options.vim
@@ -287,3 +287,55 @@ func Test_set_indentexpr()
call assert_equal('', &indentexpr)
bwipe!
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