mirror of
				https://github.com/vim/vim.git
				synced 2025-10-31 09:57:14 -04:00 
			
		
		
		
	updated for version 7.3.1187
Problem: "s:" is recognized but "<SID>" is not. (ZyX) Solution: Translate "<SID>" like "s:".
This commit is contained in:
		
							
								
								
									
										15
									
								
								src/eval.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								src/eval.c
									
									
									
									
									
								
							| @@ -10976,21 +10976,22 @@ f_function(argvars, rettv) | |||||||
| 	EMSG2(_("E700: Unknown function: %s"), s); | 	EMSG2(_("E700: Unknown function: %s"), s); | ||||||
|     else |     else | ||||||
|     { |     { | ||||||
| 	if (STRNCMP(s, "s:", 2) == 0) | 	if (STRNCMP(s, "s:", 2) == 0 || STRNCMP(s, "<SID>", 5) == 0) | ||||||
| 	{ | 	{ | ||||||
| 	    char	sid_buf[25]; | 	    char	sid_buf[25]; | ||||||
|  | 	    int		off = *s == 's' ? 2 : 5; | ||||||
|  |  | ||||||
| 	    /* Expand s: into <SNR>nr_, so that the function can also be | 	    /* Expand s: and <SID> into <SNR>nr_, so that the function can | ||||||
| 	     * called from another script. Using trans_function_name() would | 	     * also be called from another script. Using trans_function_name() | ||||||
| 	     * also work, but some plugins depend on the name being printable | 	     * would also work, but some plugins depend on the name being | ||||||
| 	     * text. */ | 	     * printable text. */ | ||||||
| 	    sprintf(sid_buf, "<SNR>%ld_", (long)current_SID); | 	    sprintf(sid_buf, "<SNR>%ld_", (long)current_SID); | ||||||
| 	    rettv->vval.v_string = | 	    rettv->vval.v_string = | ||||||
| 			    alloc((int)(STRLEN(sid_buf) + STRLEN(s + 2) + 1)); | 			    alloc((int)(STRLEN(sid_buf) + STRLEN(s + off) + 1)); | ||||||
| 	    if (rettv->vval.v_string != NULL) | 	    if (rettv->vval.v_string != NULL) | ||||||
| 	    { | 	    { | ||||||
| 		STRCPY(rettv->vval.v_string, sid_buf); | 		STRCPY(rettv->vval.v_string, sid_buf); | ||||||
| 		STRCAT(rettv->vval.v_string, s + 2); | 		STRCAT(rettv->vval.v_string, s + off); | ||||||
| 	    } | 	    } | ||||||
| 	} | 	} | ||||||
| 	else | 	else | ||||||
|   | |||||||
| @@ -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 */ | ||||||
|  | /**/ | ||||||
|  |     1187, | ||||||
| /**/ | /**/ | ||||||
|     1186, |     1186, | ||||||
| /**/ | /**/ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user