diff options
author | James McCoy <jamessan@jamessan.com> | 2016-11-16 14:12:13 -0500 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2017-06-04 22:12:14 -0400 |
commit | 03f5f78792c578520139a785c0d3d34e284c372d (patch) | |
tree | 2366ca3f86943a8e6e776b58228ea05224f2053e | |
parent | 0164a5fea3a240efc631bc10ebf1b547c2149971 (diff) | |
download | rneovim-03f5f78792c578520139a785c0d3d34e284c372d.tar.gz rneovim-03f5f78792c578520139a785c0d3d34e284c372d.tar.bz2 rneovim-03f5f78792c578520139a785c0d3d34e284c372d.zip |
vim-patch:7.4.1979
Problem: Getting value of binary option is wrong. (Kent Sibilev)
Solution: Fix type cast. Add a test.
https://github.com/vim/vim/commit/2acfbed9dbea990f129535de7ff3df360365130b
-rw-r--r-- | src/nvim/option.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_expr.vim | 23 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index defe0ad246..aed55620a1 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -4630,7 +4630,7 @@ get_option_value ( if ((int *)varp == &curbuf->b_changed) { *numval = curbufIsChanged(); } else { - *numval = (long) *(varnumber_T *)varp; + *numval = (long) *(int *)varp; } } return 1; diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 03a9155512..25cbd60114 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -98,6 +98,29 @@ func Test_special_char() call assert_fails('echo "\<C-">') endfunc +func Test_option_value() + " boolean + set bri + call assert_equal(1, &bri) + set nobri + call assert_equal(0, &bri) + + " number + set ts=1 + call assert_equal(1, &ts) + set ts=8 + call assert_equal(8, &ts) + + " string + exe "set cedit=\<Esc>" + call assert_equal("\<Esc>", &cedit) + set cpo= + call assert_equal("", &cpo) + set cpo=abcdefi + call assert_equal("abcdefi", &cpo) + set cpo&vim +endfunc + func Test_setmatches() hi def link 1 Comment hi def link 2 PreProc diff --git a/src/nvim/version.c b/src/nvim/version.c index 6838c476c1..fe8dd69fca 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -465,7 +465,7 @@ static const int included_patches[] = { // 1982 NA 1981, 1980, - // 1979, + 1979, 1978, 1977, 1976, |