From 22f6da9514eeebbb7f2344b1b0179b170b1fc9d8 Mon Sep 17 00:00:00 2001 From: Billy Su Date: Wed, 29 Apr 2020 15:49:27 +0800 Subject: vim-patch:8.2.0629: setting a boolean option to v:false does not work Problem: Setting a boolean option to v:false does not work. Solution: Do not use the string representation of the value. (Christian Brabandt, closes vim/vim#5974) https://github.com/vim/vim/commit/65d032c779a43b767497e15e6a32d04a6a8fa65d --- src/nvim/testdir/test_options.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_options.vim b/src/nvim/testdir/test_options.vim index 400af33c58..04a5c62f66 100644 --- a/src/nvim/testdir/test_options.vim +++ b/src/nvim/testdir/test_options.vim @@ -561,3 +561,18 @@ func Test_visualbell() set novisualbell set belloff=all endfunc + +" Test for setting option values using v:false and v:true +func Test_opt_boolean() + set number& + set number + call assert_equal(1, &nu) + set nonu + call assert_equal(0, &nu) + let &nu = v:true + call assert_equal(1, &nu) + let &nu = v:false + call assert_equal(0, &nu) + set number& +endfunc + -- cgit