mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	vim-patch:7.4.2239
Problem:    Warning for missing declaration of skip_vimgrep_pat(). (John
            Marriott)
Solution:   Move it to another file.
9baf297c99
			
			
This commit is contained in:
		| @@ -6159,6 +6159,50 @@ void ex_substitute(exarg_T *eap) | |||||||
|   unblock_autocmds(); |   unblock_autocmds(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | /// Skip over the pattern argument of ":vimgrep /pat/[g][j]". | ||||||
|  | /// Put the start of the pattern in "*s", unless "s" is NULL. | ||||||
|  | /// If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP. | ||||||
|  | /// If "s" is not NULL terminate the pattern with a NUL. | ||||||
|  | /// Return a pointer to the char just past the pattern plus flags. | ||||||
|  | char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags) | ||||||
|  | { | ||||||
|  |   int c; | ||||||
|  |  | ||||||
|  |   if (vim_isIDc(*p)) { | ||||||
|  |     // ":vimgrep pattern fname" | ||||||
|  |     if (s != NULL) | ||||||
|  |       *s = p; | ||||||
|  |     p = skiptowhite(p); | ||||||
|  |     if (s != NULL && *p != NUL) | ||||||
|  |       *p++ = NUL; | ||||||
|  |   } else { | ||||||
|  |     // ":vimgrep /pattern/[g][j] fname" | ||||||
|  |     if (s != NULL) | ||||||
|  |       *s = p + 1; | ||||||
|  |     c = *p; | ||||||
|  |     p = skip_regexp(p + 1, c, TRUE, NULL); | ||||||
|  |     if (*p != c) | ||||||
|  |       return NULL; | ||||||
|  |  | ||||||
|  |     // Truncate the pattern. | ||||||
|  |     if (s != NULL) | ||||||
|  |       *p = NUL; | ||||||
|  |     ++p; | ||||||
|  |  | ||||||
|  |     // Find the flags | ||||||
|  |     while (*p == 'g' || *p == 'j') { | ||||||
|  |       if (flags != NULL) { | ||||||
|  |         if (*p == 'g') | ||||||
|  |           *flags |= VGR_GLOBAL; | ||||||
|  |         else | ||||||
|  |           *flags |= VGR_NOJUMP; | ||||||
|  |       } | ||||||
|  |       ++p; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   return p; | ||||||
|  | } | ||||||
|  |  | ||||||
| /// List v:oldfiles in a nice way. | /// List v:oldfiles in a nice way. | ||||||
| void ex_oldfiles(exarg_T *eap) | void ex_oldfiles(exarg_T *eap) | ||||||
| { | { | ||||||
|   | |||||||
| @@ -3765,52 +3765,6 @@ theend: | |||||||
|   vim_regfree(regmatch.regprog); |   vim_regfree(regmatch.regprog); | ||||||
| } | } | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * Skip over the pattern argument of ":vimgrep /pat/[g][j]". |  | ||||||
|  * Put the start of the pattern in "*s", unless "s" is NULL. |  | ||||||
|  * If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP. |  | ||||||
|  * If "s" is not NULL terminate the pattern with a NUL. |  | ||||||
|  * Return a pointer to the char just past the pattern plus flags. |  | ||||||
|  */ |  | ||||||
| char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags) |  | ||||||
| { |  | ||||||
|   int c; |  | ||||||
|  |  | ||||||
|   if (vim_isIDc(*p)) { |  | ||||||
|     /* ":vimgrep pattern fname" */ |  | ||||||
|     if (s != NULL) |  | ||||||
|       *s = p; |  | ||||||
|     p = skiptowhite(p); |  | ||||||
|     if (s != NULL && *p != NUL) |  | ||||||
|       *p++ = NUL; |  | ||||||
|   } else { |  | ||||||
|     /* ":vimgrep /pattern/[g][j] fname" */ |  | ||||||
|     if (s != NULL) |  | ||||||
|       *s = p + 1; |  | ||||||
|     c = *p; |  | ||||||
|     p = skip_regexp(p + 1, c, TRUE, NULL); |  | ||||||
|     if (*p != c) |  | ||||||
|       return NULL; |  | ||||||
|  |  | ||||||
|     /* Truncate the pattern. */ |  | ||||||
|     if (s != NULL) |  | ||||||
|       *p = NUL; |  | ||||||
|     ++p; |  | ||||||
|  |  | ||||||
|     /* Find the flags */ |  | ||||||
|     while (*p == 'g' || *p == 'j') { |  | ||||||
|       if (flags != NULL) { |  | ||||||
|         if (*p == 'g') |  | ||||||
|           *flags |= VGR_GLOBAL; |  | ||||||
|         else |  | ||||||
|           *flags |= VGR_NOJUMP; |  | ||||||
|       } |  | ||||||
|       ++p; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
|   return p; |  | ||||||
| } |  | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  * Restore current working directory to "dirname_start" if they differ, taking |  * Restore current working directory to "dirname_start" if they differ, taking | ||||||
|  * into account whether it is set locally or globally. |  * into account whether it is set locally or globally. | ||||||
|   | |||||||
| @@ -205,7 +205,7 @@ static const int included_patches[] = { | |||||||
|   2242, |   2242, | ||||||
|   2241, |   2241, | ||||||
|   2240, |   2240, | ||||||
|   // 2239, |   2239, | ||||||
|   // 2238 NA |   // 2238 NA | ||||||
|   2237, |   2237, | ||||||
|   2236, |   2236, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 James McCoy
					James McCoy