mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
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:
@@ -4630,7 +4630,7 @@ get_option_value (
|
|||||||
if ((int *)varp == &curbuf->b_changed) {
|
if ((int *)varp == &curbuf->b_changed) {
|
||||||
*numval = curbufIsChanged();
|
*numval = curbufIsChanged();
|
||||||
} else {
|
} else {
|
||||||
*numval = (long) *(varnumber_T *)varp;
|
*numval = (long) *(int *)varp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -98,6 +98,29 @@ func Test_special_char()
|
|||||||
call assert_fails('echo "\<C-">')
|
call assert_fails('echo "\<C-">')
|
||||||
endfunc
|
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()
|
func Test_setmatches()
|
||||||
hi def link 1 Comment
|
hi def link 1 Comment
|
||||||
hi def link 2 PreProc
|
hi def link 2 PreProc
|
||||||
|
@@ -465,7 +465,7 @@ static const int included_patches[] = {
|
|||||||
// 1982 NA
|
// 1982 NA
|
||||||
1981,
|
1981,
|
||||||
1980,
|
1980,
|
||||||
// 1979,
|
1979,
|
||||||
1978,
|
1978,
|
||||||
1977,
|
1977,
|
||||||
1976,
|
1976,
|
||||||
|
Reference in New Issue
Block a user