mirror of
				https://github.com/vim/vim.git
				synced 2025-10-30 09:47:20 -04:00 
			
		
		
		
	updated for version 7.3.1181
Problem: Wrong error message for 1.0[0]. Solution: Check for funcref and float separately. (Yasuhiro Matsumoto)
This commit is contained in:
		
							
								
								
									
										17
									
								
								src/eval.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								src/eval.c
									
									
									
									
									
								
							| @@ -112,6 +112,7 @@ static char *e_dictrange = N_("E719: Cannot use [:] with a Dictionary"); | |||||||
| static char *e_letwrong = N_("E734: Wrong variable type for %s="); | static char *e_letwrong = N_("E734: Wrong variable type for %s="); | ||||||
| static char *e_nofunc = N_("E130: Unknown function: %s"); | static char *e_nofunc = N_("E130: Unknown function: %s"); | ||||||
| static char *e_illvar = N_("E461: Illegal variable name: %s"); | static char *e_illvar = N_("E461: Illegal variable name: %s"); | ||||||
|  | static char *e_float_as_string = N_("E806: using Float as a String"); | ||||||
|  |  | ||||||
| static dictitem_T	globvars_var;		/* variable used for g: */ | static dictitem_T	globvars_var;		/* variable used for g: */ | ||||||
| #define globvarht globvardict.dv_hashtab | #define globvarht globvardict.dv_hashtab | ||||||
| @@ -5268,16 +5269,20 @@ eval_index(arg, rettv, evaluate, verbose) | |||||||
|     char_u	*s; |     char_u	*s; | ||||||
|     char_u	*key = NULL; |     char_u	*key = NULL; | ||||||
|  |  | ||||||
|     if (rettv->v_type == VAR_FUNC |     if (rettv->v_type == VAR_FUNC) | ||||||
| #ifdef FEAT_FLOAT |  | ||||||
| 	    || rettv->v_type == VAR_FLOAT |  | ||||||
| #endif |  | ||||||
| 	    ) |  | ||||||
|     { |     { | ||||||
| 	if (verbose) | 	if (verbose) | ||||||
| 	    EMSG(_("E695: Cannot index a Funcref")); | 	    EMSG(_("E695: Cannot index a Funcref")); | ||||||
| 	return FAIL; | 	return FAIL; | ||||||
|     } |     } | ||||||
|  | #ifdef FEAT_FLOAT | ||||||
|  |     else if (rettv->v_type == VAR_FLOAT) | ||||||
|  |     { | ||||||
|  | 	if (verbose) | ||||||
|  | 	    EMSG(_(e_float_as_string)); | ||||||
|  | 	return FAIL; | ||||||
|  |     } | ||||||
|  | #endif | ||||||
|  |  | ||||||
|     if (**arg == '.') |     if (**arg == '.') | ||||||
|     { |     { | ||||||
| @@ -20085,7 +20090,7 @@ get_tv_string_buf_chk(varp, buf) | |||||||
| 	    break; | 	    break; | ||||||
| #ifdef FEAT_FLOAT | #ifdef FEAT_FLOAT | ||||||
| 	case VAR_FLOAT: | 	case VAR_FLOAT: | ||||||
| 	    EMSG(_("E806: using Float as a String")); | 	    EMSG(_(e_float_as_string)); | ||||||
| 	    break; | 	    break; | ||||||
| #endif | #endif | ||||||
| 	case VAR_STRING: | 	case VAR_STRING: | ||||||
|   | |||||||
| @@ -728,6 +728,8 @@ static char *(features[]) = | |||||||
|  |  | ||||||
| static int included_patches[] = | static int included_patches[] = | ||||||
| {   /* Add new patch number below this line */ | {   /* Add new patch number below this line */ | ||||||
|  | /**/ | ||||||
|  |     1181, | ||||||
| /**/ | /**/ | ||||||
|     1180, |     1180, | ||||||
| /**/ | /**/ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user