diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-06-15 17:12:48 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-06-15 17:12:48 +0200 |
commit | d7c968794710f338d491072171df48f96612cf72 (patch) | |
tree | d5edca7e09283ff5c345d8e113a10829a70412a2 /src/eval.c | |
parent | bffc50494d52a3690cbbc5c7b34a835f9153184e (diff) |
patch 8.1.1542: an OptionSet autocommand does not get enough infov8.1.1542
Problem: An OptionSet autocommand does not get enough info.
Solution: Add v:option_command, v:option_oldlocal and v:option_oldglobal.
(Latrice Wilgus, closes #4118)
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index cdaf103a28..43866e657e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -172,6 +172,9 @@ static struct vimvar {VV_NAME("completed_item", VAR_DICT), VV_RO}, {VV_NAME("option_new", VAR_STRING), VV_RO}, {VV_NAME("option_old", VAR_STRING), VV_RO}, + {VV_NAME("option_oldlocal", VAR_STRING), VV_RO}, + {VV_NAME("option_oldglobal", VAR_STRING), VV_RO}, + {VV_NAME("option_command", VAR_STRING), VV_RO}, {VV_NAME("option_type", VAR_STRING), VV_RO}, {VV_NAME("errors", VAR_LIST), 0}, {VV_NAME("false", VAR_SPECIAL), VV_RO}, @@ -337,7 +340,7 @@ eval_init(void) for (i = 0; i < VV_LEN; ++i) { p = &vimvars[i]; - if (STRLEN(p->vv_name) > 16) + if (STRLEN(p->vv_name) > DICTITEM16_KEY_LEN) { iemsg("INTERNAL: name too long, increase size of dictitem16_T"); getout(1); @@ -9500,14 +9503,18 @@ last_set_msg(sctx_T script_ctx) } /* - * Reset v:option_new, v:option_old and v:option_type. + * reset v:option_new, v:option_old, v:option_oldlocal, v:option_oldglobal, + * v:option_type, and v:option_command. */ void reset_v_option_vars(void) { set_vim_var_string(VV_OPTION_NEW, NULL, -1); set_vim_var_string(VV_OPTION_OLD, NULL, -1); + set_vim_var_string(VV_OPTION_OLDLOCAL, NULL, -1); + set_vim_var_string(VV_OPTION_OLDGLOBAL, NULL, -1); set_vim_var_string(VV_OPTION_TYPE, NULL, -1); + set_vim_var_string(VV_OPTION_COMMAND, NULL, -1); } /* |