@@ -643,7 +643,7 @@ check_number_or_float(vartype_T type1, vartype_T type2, char_u *op)
643643 || type2 == VAR_ANY )))
644644 {
645645 if (* op == '+' )
646- emsg (_ ("E1035 : wrong argument type for +" ));
646+ emsg (_ ("E1051 : wrong argument type for +" ));
647647 else
648648 semsg (_ ("E1036: %c requires number or float arguments" ), * op );
649649 return FAIL ;
@@ -6695,6 +6695,7 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
66956695 {
66966696 exarg_T ea ;
66976697 int starts_with_colon = FALSE;
6698+ char_u * cmd ;
66986699
66996700 // Bail out on the first error to avoid a flood of errors and report
67006701 // the right line number when inside try/catch.
@@ -6853,7 +6854,13 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
68536854 /*
68546855 * COMMAND after range
68556856 */
6857+ cmd = ea .cmd ;
68566858 ea .cmd = skip_range (ea .cmd , NULL );
6859+ if (ea .cmd > cmd && !starts_with_colon )
6860+ {
6861+ emsg (_ (e_colon_required ));
6862+ goto erret ;
6863+ }
68576864 p = find_ex_command (& ea , NULL , starts_with_colon ? NULL
68586865 : (void * (* )(char_u * , size_t , cctx_T * ))lookup_local ,
68596866 & cctx );
@@ -7008,8 +7015,9 @@ compile_def_function(ufunc_T *ufunc, int set_return_type, cctx_T *outer_cctx)
70087015 line = compile_mult_expr (p , ea .cmdidx , & cctx );
70097016 break ;
70107017
7018+ // TODO: other commands with an expression argument
7019+
70117020 default :
7012- // TODO: other commands with an expression argument
70137021 // Not recognized, execute with do_cmdline_cmd().
70147022 ea .arg = p ;
70157023 line = compile_exec (line , & ea , & cctx );
0 commit comments