Skip to content

Commit c43a8b8

Browse files
committed
patch 8.0.0369: a few options are not defined, depending on features
Problem: The 'balloondelay', 'ballooneval' and 'balloonexpr' options are not defined without the +balloon_eval feature. Testing that an option value fails does not work for unsupported options. Solution: Make the options defined but not supported. Don't test if setting unsupported options fails.
1 parent 2f5463d commit c43a8b8

File tree

3 files changed

+28
-8
lines changed

3 files changed

+28
-8
lines changed

src/gen_opt_test.vim

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ let test_values = {
2727
\ 'foldcolumn': [[0, 1, 4, 12], [-1, 13, 999]],
2828
\ 'helpheight': [[0, 10, 100], [-1]],
2929
\ 'history': [[0, 1, 100], [-1, 10001]],
30-
\ 'iminsert': [[0, 1, 2], [-1, 3, 999]],
31-
\ 'imsearch': [[-1, 0, 1, 2], [-2, 3, 999]],
30+
\ 'iminsert': [[0, 1], [-1, 3, 999]],
31+
\ 'imsearch': [[-1, 0, 1], [-2, 3, 999]],
3232
\ 'lines': [[2, 24], [-1, 0, 1]],
3333
\ 'numberwidth': [[1, 4, 8, 10], [-1, 0, 11]],
3434
\ 'regexpengine': [[0, 1, 2], [-1, 3, 999]],
@@ -170,10 +170,14 @@ while 1
170170
call add(script, 'set ' . name . '=' . val)
171171
call add(script, 'set ' . shortname . '=' . val)
172172
endfor
173+
174+
" setting an option can only fail when it's implemented.
175+
call add(script, "if exists('+" . name . "')")
173176
for val in a[1]
174177
call add(script, "call assert_fails('set " . name . "=" . val . "')")
175178
call add(script, "call assert_fails('set " . shortname . "=" . val . "')")
176179
endfor
180+
call add(script, "endif")
177181
endif
178182

179183
call add(script, 'set ' . name . '&')

src/option.c

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,19 +624,33 @@ static struct vimoption options[] =
624624
{(char_u *)0L, (char_u *)0L}
625625
#endif
626626
SCRIPTID_INIT},
627-
#ifdef FEAT_BEVAL
628627
{"balloondelay","bdlay",P_NUM|P_VI_DEF,
628+
#ifdef FEAT_BEVAL
629629
(char_u *)&p_bdlay, PV_NONE,
630-
{(char_u *)600L, (char_u *)0L} SCRIPTID_INIT},
630+
{(char_u *)600L, (char_u *)0L}
631+
#else
632+
(char_u *)NULL, PV_NONE,
633+
{(char_u *)0L, (char_u *)0L}
634+
#endif
635+
SCRIPTID_INIT},
631636
{"ballooneval", "beval",P_BOOL|P_VI_DEF|P_NO_MKRC,
637+
#ifdef FEAT_BEVAL
632638
(char_u *)&p_beval, PV_NONE,
633-
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
634-
# ifdef FEAT_EVAL
639+
{(char_u *)FALSE, (char_u *)0L}
640+
#else
641+
(char_u *)NULL, PV_NONE,
642+
{(char_u *)0L, (char_u *)0L}
643+
#endif
644+
SCRIPTID_INIT},
635645
{"balloonexpr", "bexpr", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM,
646+
#if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
636647
(char_u *)&p_bexpr, PV_BEXPR,
637-
{(char_u *)"", (char_u *)0L} SCRIPTID_INIT},
638-
# endif
648+
{(char_u *)"", (char_u *)0L}
649+
#else
650+
(char_u *)NULL, PV_NONE,
651+
{(char_u *)0L, (char_u *)0L}
639652
#endif
653+
SCRIPTID_INIT},
640654
{"beautify", "bf", P_BOOL|P_VI_DEF,
641655
(char_u *)NULL, PV_NONE,
642656
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
369,
767769
/**/
768770
368,
769771
/**/

0 commit comments

Comments
 (0)