diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-04-23 22:40:29 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-04-23 22:40:29 +0000 |
commit | 4a85b4156098a30daf5b15a7fb7587a1c7c99f94 (patch) | |
tree | a1874218752c56897f955c24b012836b8c9e80f8 /src/eval.c | |
parent | eb3593b38b7b6b658e93ad05d6caf76d58cc0c35 (diff) |
updated for version 7.0e07v7.0e07
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index 14460a0a9a..0802784167 100644 --- a/src/eval.c +++ b/src/eval.c @@ -587,6 +587,7 @@ static void f_pathshorten __ARGS((typval_T *argvars, typval_T *rettv)); static void f_prevnonblank __ARGS((typval_T *argvars, typval_T *rettv)); static void f_printf __ARGS((typval_T *argvars, typval_T *rettv)); static void f_pumvisible __ARGS((typval_T *argvars, typval_T *rettv)); +static void f_pushkeys __ARGS((typval_T *argvars, typval_T *rettv)); static void f_range __ARGS((typval_T *argvars, typval_T *rettv)); static void f_readfile __ARGS((typval_T *argvars, typval_T *rettv)); static void f_reltime __ARGS((typval_T *argvars, typval_T *rettv)); @@ -7101,6 +7102,7 @@ static struct fst {"prevnonblank", 1, 1, f_prevnonblank}, {"printf", 2, 19, f_printf}, {"pumvisible", 0, 0, f_pumvisible}, + {"pushkeys", 1, 2, f_pushkeys}, {"range", 1, 3, f_range}, {"readfile", 1, 3, f_readfile}, {"reltime", 0, 2, f_reltime}, @@ -12619,6 +12621,42 @@ f_pumvisible(argvars, rettv) } /* + * "pushkeys()" function + */ +/*ARGSUSED*/ + static void +f_pushkeys(argvars, rettv) + typval_T *argvars; + typval_T *rettv; +{ + int remap = TRUE; + char_u *keys, *flags; + char_u nbuf[NUMBUFLEN]; + + rettv->vval.v_number = 0; + keys = get_tv_string(&argvars[0]); + if (*keys != NUL) + { + if (argvars[1].v_type != VAR_UNKNOWN) + { + flags = get_tv_string_buf(&argvars[1], nbuf); + for ( ; *flags != NUL; ++flags) + { + switch (*flags) + { + case 'n': remap = FALSE; break; + case 'm': remap = TRUE; break; + } + } + } + + ins_typebuf(keys, (remap ? REMAP_YES : REMAP_NONE), + typebuf.tb_len, TRUE, FALSE); + typebuf_was_filled = TRUE; + } +} + +/* * "range()" function */ static void |