1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
| | To: vim_dev@googlegroups.com
Subject: Patch 8.0.0003
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 8.0.0003
Problem: getwinvar() returns wrong Value of boolean and number options,
especially non big endian systems. (James McCoy)
Solution: Cast the pointer to long or int. (closes #1060)
Files: src/option.c, src/testdir/test_bufwintabinfo.vim
*** vim80/src/option.c 2016-09-02 19:26:03.000000000 +0200
--- vim80/src/option.c 2016-09-12 19:20:38.051099762 +0200
***************
*** 12363,12370 ****
{
if (opt->flags & P_STRING)
dict_add_nr_str(d, opt->fullname, 0L, *(char_u **)varp);
else
! dict_add_nr_str(d, opt->fullname, *varp, NULL);
}
}
}
--- 12363,12372 ----
{
if (opt->flags & P_STRING)
dict_add_nr_str(d, opt->fullname, 0L, *(char_u **)varp);
+ else if (opt->flags & P_NUM)
+ dict_add_nr_str(d, opt->fullname, *(long *)varp, NULL);
else
! dict_add_nr_str(d, opt->fullname, *(int *)varp, NULL);
}
}
}
*** vim80/src/testdir/test_bufwintabinfo.vim 2016-08-27 21:14:58.000000000 +0200
--- vim80/src/testdir/test_bufwintabinfo.vim 2016-09-12 19:31:06.346360420 +0200
***************
*** 87,95 ****
--- 87,103 ----
endfunc
function Test_get_win_options()
+ if has('folding')
+ set foldlevel=999
+ endif
+ set list
let opts = getwinvar(1, '&')
call assert_equal(v:t_dict, type(opts))
call assert_equal(0, opts.linebreak)
+ call assert_equal(1, opts.list)
+ if has('folding')
+ call assert_equal(999, opts.foldlevel)
+ endif
if has('signs')
call assert_equal('auto', opts.signcolumn)
endif
***************
*** 97,103 ****
--- 105,116 ----
let opts = gettabwinvar(1, 1, '&')
call assert_equal(v:t_dict, type(opts))
call assert_equal(0, opts.linebreak)
+ call assert_equal(1, opts.list)
if has('signs')
call assert_equal('auto', opts.signcolumn)
endif
+ set list&
+ if has('folding')
+ set foldlevel=0
+ endif
endfunc
*** vim80/src/version.c 2016-09-12 16:30:42.348454179 +0200
--- vim80/src/version.c 2016-09-12 19:24:10.184148642 +0200
***************
*** 766,767 ****
--- 766,769 ----
{ /* Add new patch number below this line */
+ /**/
+ 3,
/**/
--
|