# HG changeset patch # User Christian Brabandt # Date 1488058204 -3600 # Node ID 398ad090256dd560256be9e8717382ad25a1ca49 # Parent c6125f350427618ff62580855f071b79552740aa patch 8.0.0372: more options are not always defined commit https://github.com/vim/vim/commit/a713ff819d134dc34e507c05273c935bfc17e795 Author: Bram Moolenaar Date: Sat Feb 25 22:18:43 2017 +0100 patch 8.0.0372: more options are not always defined Problem: More options are not always defined. Solution: Consistently define all possible options. diff --git a/src/option.c b/src/option.c --- a/src/option.c +++ b/src/option.c @@ -559,11 +559,15 @@ static struct vimoption options[] = {(char_u *)0L, (char_u *)0L} #endif SCRIPTID_INIT}, + {"autochdir", "acd", P_BOOL|P_VI_DEF, #ifdef FEAT_AUTOCHDIR - {"autochdir", "acd", P_BOOL|P_VI_DEF, (char_u *)&p_acd, PV_NONE, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, -#endif + {(char_u *)FALSE, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)0L, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"autoindent", "ai", P_BOOL|P_VI_DEF, (char_u *)&p_ai, PV_AI, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, @@ -1210,62 +1214,125 @@ static struct vimoption options[] = {"flash", "fl", P_BOOL|P_VI_DEF, (char_u *)NULL, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {"foldclose", "fcl", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_RWIN, #ifdef FEAT_FOLDING - {"foldclose", "fcl", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_RWIN, (char_u *)&p_fcl, PV_NONE, - {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)"", (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldcolumn", "fdc", P_NUM|P_VI_DEF|P_RWIN, +#ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDC, - {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)FALSE, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldenable", "fen", P_BOOL|P_VI_DEF|P_RWIN, +#ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FEN, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)TRUE, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldexpr", "fde", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN, -# ifdef FEAT_EVAL +#if defined(FEAT_FOLDING) && defined(FEAT_EVAL) (char_u *)VAR_WIN, PV_FDE, {(char_u *)"0", (char_u *)NULL} -# else +#else (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} -# endif +#endif SCRIPTID_INIT}, {"foldignore", "fdi", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN, +#ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDI, - {(char_u *)"#", (char_u *)NULL} SCRIPTID_INIT}, + {(char_u *)"#", (char_u *)NULL} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldlevel", "fdl", P_NUM|P_VI_DEF|P_RWIN, +#ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDL, - {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)0L, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldlevelstart","fdls", P_NUM|P_VI_DEF|P_CURSWANT, +#ifdef FEAT_FOLDING (char_u *)&p_fdls, PV_NONE, - {(char_u *)-1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)-1L, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldmarker", "fmr", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF| +#ifdef FEAT_FOLDING P_RWIN|P_ONECOMMA|P_NODUP, (char_u *)VAR_WIN, PV_FMR, {(char_u *)"{{{,}}}", (char_u *)NULL} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif SCRIPTID_INIT}, {"foldmethod", "fdm", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN, +#ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDM, - {(char_u *)"manual", (char_u *)NULL} SCRIPTID_INIT}, + {(char_u *)"manual", (char_u *)NULL} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldminlines","fml", P_NUM|P_VI_DEF|P_RWIN, +#ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FML, - {(char_u *)1L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)1L, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldnestmax", "fdn", P_NUM|P_VI_DEF|P_RWIN, +#ifdef FEAT_FOLDING (char_u *)VAR_WIN, PV_FDN, - {(char_u *)20L, (char_u *)0L} SCRIPTID_INIT}, + {(char_u *)20L, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldopen", "fdo", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP|P_CURSWANT, +#ifdef FEAT_FOLDING (char_u *)&p_fdo, PV_NONE, {(char_u *)"block,hor,mark,percent,quickfix,search,tag,undo", - (char_u *)0L} SCRIPTID_INIT}, + (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"foldtext", "fdt", P_STRING|P_ALLOCED|P_VIM|P_VI_DEF|P_RWIN, -# ifdef FEAT_EVAL +#if defined(FEAT_FOLDING) && defined(FEAT_EVAL) (char_u *)VAR_WIN, PV_FDT, {(char_u *)"foldtext()", (char_u *)NULL} -# else +#else (char_u *)NULL, PV_NONE, {(char_u *)NULL, (char_u *)0L} -# endif - SCRIPTID_INIT}, -#endif +#endif + SCRIPTID_INIT}, {"formatexpr", "fex", P_STRING|P_ALLOCED|P_VI_DEF|P_VIM, #ifdef FEAT_EVAL (char_u *)&p_fex, PV_FEX, @@ -1803,17 +1870,24 @@ static struct vimoption options[] = {"loadplugins", "lpl", P_BOOL|P_VI_DEF, (char_u *)&p_lpl, PV_NONE, {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {"luadll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_LUA) - {"luadll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_luadll, PV_NONE, {(char_u *)DYNAMIC_LUA_DLL, (char_u *)0L} - SCRIPTID_INIT}, -#endif -#ifdef FEAT_GUI_MAC +#else + (char_u *)NULL, PV_NONE, + {(char_u *)"", (char_u *)0L} +#endif + SCRIPTID_INIT}, {"macatsui", NULL, P_BOOL|P_VI_DEF|P_RCLR, +#ifdef FEAT_GUI_MAC (char_u *)&p_macatsui, PV_NONE, - {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, -#endif + {(char_u *)TRUE, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)"", (char_u *)0L} +#endif + SCRIPTID_INIT}, {"magic", NULL, P_BOOL|P_VI_DEF, (char_u *)&p_magic, PV_NONE, {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, @@ -2045,12 +2119,15 @@ static struct vimoption options[] = (char_u *)".,/usr/include,,", #endif (char_u *)0L} SCRIPTID_INIT}, + {"perldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_PERL) - {"perldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_perldll, PV_NONE, {(char_u *)DYNAMIC_PERL_DLL, (char_u *)0L} - SCRIPTID_INIT}, -#endif +#else + (char_u *)NULL, PV_NONE, + {(char_u *)0L, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"preserveindent", "pi", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_pi, PV_PI, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, @@ -2156,18 +2233,24 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, #endif {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT}, + {"pythonthreedll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_PYTHON3) - {"pythonthreedll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_py3dll, PV_NONE, {(char_u *)DYNAMIC_PYTHON3_DLL, (char_u *)0L} - SCRIPTID_INIT}, -#endif +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, + {"pythondll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_PYTHON) - {"pythondll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_pydll, PV_NONE, {(char_u *)DYNAMIC_PYTHON_DLL, (char_u *)0L} - SCRIPTID_INIT}, -#endif +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"pyxversion", "pyx", P_NUM|P_VI_DEF|P_SECURE, #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) (char_u *)&p_pyx, PV_NONE, @@ -2249,12 +2332,15 @@ static struct vimoption options[] = {(char_u *)NULL, (char_u *)0L} #endif SCRIPTID_INIT}, + {"rubydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_RUBY) - {"rubydll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_rubydll, PV_NONE, {(char_u *)DYNAMIC_RUBY_DLL, (char_u *)0L} - SCRIPTID_INIT}, -#endif +#else + (char_u *)NULL, PV_NONE, + {(char_u *)NULL, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"ruler", "ru", P_BOOL|P_VI_DEF|P_VIM|P_RSTAT, #ifdef FEAT_CMDL_INFO (char_u *)&p_ru, PV_NONE, @@ -2642,12 +2728,15 @@ static struct vimoption options[] = {"tagstack", "tgst", P_BOOL|P_VI_DEF, (char_u *)&p_tgst, PV_NONE, {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, + {"tcldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, #if defined(DYNAMIC_TCL) - {"tcldll", NULL, P_STRING|P_EXPAND|P_VI_DEF|P_SECURE, (char_u *)&p_tcldll, PV_NONE, {(char_u *)DYNAMIC_TCL_DLL, (char_u *)0L} - SCRIPTID_INIT}, -#endif +#else + (char_u *)NULL, PV_NONE, + {(char_u *)0L, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"term", NULL, P_STRING|P_EXPAND|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RALL, (char_u *)&T_NAME, PV_NONE, {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, @@ -2742,17 +2831,24 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, #endif {(char_u *)"", (char_u *)0L} SCRIPTID_INIT}, + {"toolbar", "tb", P_STRING|P_ONECOMMA|P_VI_DEF|P_NODUP, #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32) - {"toolbar", "tb", P_STRING|P_ONECOMMA|P_VI_DEF|P_NODUP, (char_u *)&p_toolbar, PV_NONE, {(char_u *)"icons,tooltips", (char_u *)0L} - SCRIPTID_INIT}, -#endif -#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) +#else + (char_u *)NULL, PV_NONE, + {(char_u *)0L, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"toolbariconsize", "tbis", P_STRING|P_VI_DEF, +#if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) (char_u *)&p_tbis, PV_NONE, - {(char_u *)"small", (char_u *)0L} SCRIPTID_INIT}, -#endif + {(char_u *)"small", (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, + {(char_u *)0L, (char_u *)0L} +#endif + SCRIPTID_INIT}, {"ttimeout", NULL, P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_ttimeout, PV_NONE, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, diff --git a/src/testdir/test_expand_dllpath.vim b/src/testdir/test_expand_dllpath.vim --- a/src/testdir/test_expand_dllpath.vim +++ b/src/testdir/test_expand_dllpath.vim @@ -14,7 +14,7 @@ func s:test_expand_dllpath(optname) endfunc func s:generate_test_if_exists(optname) - if exists('&' . a:optname) + if exists('+' . a:optname) execute join([ \ 'func Test_expand_' . a:optname . '()', \ ' call s:test_expand_dllpath("' . a:optname . '")', diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 372, +/**/ 371, /**/ 370,