mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06: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:
parent
0164a5fea3
commit
03f5f78792
@ -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;
|
||||
|
@ -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
|
||||
|
@ -465,7 +465,7 @@ static const int included_patches[] = {
|
||||
// 1982 NA
|
||||
1981,
|
||||
1980,
|
||||
// 1979,
|
||||
1979,
|
||||
1978,
|
||||
1977,
|
||||
1976,
|
||||
|
Loading…
Reference in New Issue
Block a user