comparison src/normal.c @ 14071:c1fcfafa8d1a v8.1.0053

patch 8.1.0053: first argument of 'completefunc' has inconsistent type commit https://github.com/vim/vim/commit/ffa9684150f5441e84d492e7184ef73587bd6c6c Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 12 22:05:14 2018 +0200 patch 8.1.0053: first argument of 'completefunc' has inconsistent type 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)
author Christian Brabandt <cb@256bit.org>
date Tue, 12 Jun 2018 22:15:06 +0200
parents dc67449d648c
children 19d99d9e670c
comparison
equal deleted inserted replaced
14070:e5b1d05b7b77 14071:c1fcfafa8d1a
2217 */ 2217 */
2218 static void 2218 static void
2219 op_function(oparg_T *oap UNUSED) 2219 op_function(oparg_T *oap UNUSED)
2220 { 2220 {
2221 #ifdef FEAT_EVAL 2221 #ifdef FEAT_EVAL
2222 char_u *(argv[1]); 2222 typval_T argv[2];
2223 # ifdef FEAT_VIRTUALEDIT 2223 # ifdef FEAT_VIRTUALEDIT
2224 int save_virtual_op = virtual_op; 2224 int save_virtual_op = virtual_op;
2225 # endif 2225 # endif
2226 2226
2227 if (*p_opfunc == NUL) 2227 if (*p_opfunc == NUL)
2233 curbuf->b_op_end = oap->end; 2233 curbuf->b_op_end = oap->end;
2234 if (oap->motion_type != MLINE && !oap->inclusive) 2234 if (oap->motion_type != MLINE && !oap->inclusive)
2235 /* Exclude the end position. */ 2235 /* Exclude the end position. */
2236 decl(&curbuf->b_op_end); 2236 decl(&curbuf->b_op_end);
2237 2237
2238 argv[0].v_type = VAR_STRING;
2238 if (oap->block_mode) 2239 if (oap->block_mode)
2239 argv[0] = (char_u *)"block"; 2240 argv[0].vval.v_string = (char_u *)"block";
2240 else if (oap->motion_type == MLINE) 2241 else if (oap->motion_type == MLINE)
2241 argv[0] = (char_u *)"line"; 2242 argv[0].vval.v_string = (char_u *)"line";
2242 else 2243 else
2243 argv[0] = (char_u *)"char"; 2244 argv[0].vval.v_string = (char_u *)"char";
2245 argv[1].v_type = VAR_UNKNOWN;
2244 2246
2245 # ifdef FEAT_VIRTUALEDIT 2247 # ifdef FEAT_VIRTUALEDIT
2246 /* Reset virtual_op so that 'virtualedit' can be changed in the 2248 /* Reset virtual_op so that 'virtualedit' can be changed in the
2247 * function. */ 2249 * function. */
2248 virtual_op = MAYBE; 2250 virtual_op = MAYBE;