diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-06-12 22:05:14 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-06-12 22:05:14 +0200 |
commit | ffa9684150f5441e84d492e7184ef73587bd6c6c (patch) | |
tree | e73aa4b5e0d37ef4d113fcb07f9e1efa5c01d133 /src/normal.c | |
parent | 83f4cbd973731872b633d6ba0caf850fb708d70c (diff) | |
download | vim-git-ffa9684150f5441e84d492e7184ef73587bd6c6c.tar.gz |
patch 8.1.0053: first argument of 'completefunc' has inconsistent typev8.1.0053
Problem: The first argument given to 'completefunc' can be Number or
String, depending on the value.
Solution: Avoid guessing the type of an argument, use typval_T in the
callers of call_vim_function(). (Ozaki Kiichi, closes #2993)
Diffstat (limited to 'src/normal.c')
-rw-r--r-- | src/normal.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/normal.c b/src/normal.c index a01a43486..4d51c3320 100644 --- a/src/normal.c +++ b/src/normal.c @@ -2219,7 +2219,7 @@ op_colon(oparg_T *oap) op_function(oparg_T *oap UNUSED) { #ifdef FEAT_EVAL - char_u *(argv[1]); + typval_T argv[2]; # ifdef FEAT_VIRTUALEDIT int save_virtual_op = virtual_op; # endif @@ -2235,12 +2235,14 @@ op_function(oparg_T *oap UNUSED) /* Exclude the end position. */ decl(&curbuf->b_op_end); + argv[0].v_type = VAR_STRING; if (oap->block_mode) - argv[0] = (char_u *)"block"; + argv[0].vval.v_string = (char_u *)"block"; else if (oap->motion_type == MLINE) - argv[0] = (char_u *)"line"; + argv[0].vval.v_string = (char_u *)"line"; else - argv[0] = (char_u *)"char"; + argv[0].vval.v_string = (char_u *)"char"; + argv[1].v_type = VAR_UNKNOWN; # ifdef FEAT_VIRTUALEDIT /* Reset virtual_op so that 'virtualedit' can be changed in the |