vim-patch:7.4.1979

Problem:    Getting value of binary option is wrong. (Kent Sibilev)
Solution:   Fix type cast.  Add a test.

2acfbed9db
This commit is contained in:
James McCoy 2016-11-16 14:12:13 -05:00
parent 0164a5fea3
commit 03f5f78792
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
3 changed files with 25 additions and 2 deletions

View File

@ -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;

View File

@ -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

View File

@ -465,7 +465,7 @@ static const int included_patches[] = {
// 1982 NA
1981,
1980,
// 1979,
1979,
1978,
1977,
1976,