Mercurial > vim
comparison src/ex_cmds.c @ 9931:05bfc3d37efb v7.4.2239
commit https://github.com/vim/vim/commit/9baf297c99cc35adb921bee04369499d76438889
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Aug 21 22:39:35 2016 +0200
patch 7.4.2239
Problem: Warning for missing declaration of skip_vimgrep_pat(). (John
Marriott)
Solution: Move it to another file.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 21 Aug 2016 22:45:06 +0200 |
parents | 4da1a3879100 |
children | d63a89b526ea |
comparison
equal
deleted
inserted
replaced
9930:0b494d8c3410 | 9931:05bfc3d37efb |
---|---|
8390 ex_rewind(eap); | 8390 ex_rewind(eap); |
8391 } | 8391 } |
8392 } | 8392 } |
8393 #endif | 8393 #endif |
8394 | 8394 |
8395 #if defined(FEAT_QUICKFIX) || defined(FEAT_EVAL) || defined(PROTO) | |
8396 /* | |
8397 * Skip over the pattern argument of ":vimgrep /pat/[g][j]". | |
8398 * Put the start of the pattern in "*s", unless "s" is NULL. | |
8399 * If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP. | |
8400 * If "s" is not NULL terminate the pattern with a NUL. | |
8401 * Return a pointer to the char just past the pattern plus flags. | |
8402 */ | |
8403 char_u * | |
8404 skip_vimgrep_pat(char_u *p, char_u **s, int *flags) | |
8405 { | |
8406 int c; | |
8407 | |
8408 if (vim_isIDc(*p)) | |
8409 { | |
8410 /* ":vimgrep pattern fname" */ | |
8411 if (s != NULL) | |
8412 *s = p; | |
8413 p = skiptowhite(p); | |
8414 if (s != NULL && *p != NUL) | |
8415 *p++ = NUL; | |
8416 } | |
8417 else | |
8418 { | |
8419 /* ":vimgrep /pattern/[g][j] fname" */ | |
8420 if (s != NULL) | |
8421 *s = p + 1; | |
8422 c = *p; | |
8423 p = skip_regexp(p + 1, c, TRUE, NULL); | |
8424 if (*p != c) | |
8425 return NULL; | |
8426 | |
8427 /* Truncate the pattern. */ | |
8428 if (s != NULL) | |
8429 *p = NUL; | |
8430 ++p; | |
8431 | |
8432 /* Find the flags */ | |
8433 while (*p == 'g' || *p == 'j') | |
8434 { | |
8435 if (flags != NULL) | |
8436 { | |
8437 if (*p == 'g') | |
8438 *flags |= VGR_GLOBAL; | |
8439 else | |
8440 *flags |= VGR_NOJUMP; | |
8441 } | |
8442 ++p; | |
8443 } | |
8444 } | |
8445 return p; | |
8446 } | |
8447 #endif | |
8448 | |
8395 #if defined(FEAT_EVAL) || defined(PROTO) | 8449 #if defined(FEAT_EVAL) || defined(PROTO) |
8396 /* | 8450 /* |
8397 * List v:oldfiles in a nice way. | 8451 * List v:oldfiles in a nice way. |
8398 */ | 8452 */ |
8399 void | 8453 void |