comparison src/quickfix.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 adef2643c576
children e24aa20d815c
comparison
equal deleted inserted replaced
9930:0b494d8c3410 9931:05bfc3d37efb
5153 curwin->w_llist = qi; 5153 curwin->w_llist = qi;
5154 } 5154 }
5155 } 5155 }
5156 5156
5157 #endif /* FEAT_QUICKFIX */ 5157 #endif /* FEAT_QUICKFIX */
5158
5159 #if defined(FEAT_QUICKFIX) || defined(FEAT_EVAL) || defined(PROTO)
5160 /*
5161 * Skip over the pattern argument of ":vimgrep /pat/[g][j]".
5162 * Put the start of the pattern in "*s", unless "s" is NULL.
5163 * If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP.
5164 * If "s" is not NULL terminate the pattern with a NUL.
5165 * Return a pointer to the char just past the pattern plus flags.
5166 */
5167 char_u *
5168 skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
5169 {
5170 int c;
5171
5172 if (vim_isIDc(*p))
5173 {
5174 /* ":vimgrep pattern fname" */
5175 if (s != NULL)
5176 *s = p;
5177 p = skiptowhite(p);
5178 if (s != NULL && *p != NUL)
5179 *p++ = NUL;
5180 }
5181 else
5182 {
5183 /* ":vimgrep /pattern/[g][j] fname" */
5184 if (s != NULL)
5185 *s = p + 1;
5186 c = *p;
5187 p = skip_regexp(p + 1, c, TRUE, NULL);
5188 if (*p != c)
5189 return NULL;
5190
5191 /* Truncate the pattern. */
5192 if (s != NULL)
5193 *p = NUL;
5194 ++p;
5195
5196 /* Find the flags */
5197 while (*p == 'g' || *p == 'j')
5198 {
5199 if (flags != NULL)
5200 {
5201 if (*p == 'g')
5202 *flags |= VGR_GLOBAL;
5203 else
5204 *flags |= VGR_NOJUMP;
5205 }
5206 ++p;
5207 }
5208 }
5209 return p;
5210 }
5211 #endif