4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Can't use cscope with QuickFixCmdPre and QuickFixCmdPost.
12 Solution: Add cscope support for these autocmd events. (Bryan Venteicher)
13 Files: runtime/doc/autocmd.txt, src/if_cscope.c
16 *** ../vim-7.2.432/runtime/doc/autocmd.txt 2009-06-24 17:51:01.000000000 +0200
17 --- runtime/doc/autocmd.txt 2010-05-14 22:48:43.000000000 +0200
20 QuickFixCmdPre Before a quickfix command is run (|:make|,
21 |:lmake|, |:grep|, |:lgrep|, |:grepadd|,
22 |:lgrepadd|, |:vimgrep|, |:lvimgrep|,
23 ! |:vimgrepadd|, |:lvimgrepadd|). The pattern is
24 ! matched against the command being run. When
25 ! |:grep| is used but 'grepprg' is set to
26 ! "internal" it still matches "grep".
27 This command cannot be used to set the
28 'makeprg' and 'grepprg' variables.
29 If this command causes an error, the quickfix
31 QuickFixCmdPre Before a quickfix command is run (|:make|,
32 |:lmake|, |:grep|, |:lgrep|, |:grepadd|,
33 |:lgrepadd|, |:vimgrep|, |:lvimgrep|,
34 ! |:vimgrepadd|, |:lvimgrepadd|, |:cscope|).
35 ! The pattern is matched against the command
36 ! being run. When |:grep| is used but 'grepprg'
37 ! is set to "internal" it still matches "grep".
38 This command cannot be used to set the
39 'makeprg' and 'grepprg' variables.
40 If this command causes an error, the quickfix
41 *** ../vim-7.2.432/src/if_cscope.c 2010-02-24 14:46:58.000000000 +0100
42 --- src/if_cscope.c 2010-05-14 23:10:39.000000000 +0200
50 + /* get cmd letter */
81 + qfpos = (char *)vim_strchr(p_csqf, cmdletter);
85 + /* next symbol must be + or - */
86 + if (strchr(CSQF_FLAGS, *qfpos) == NULL)
88 + char *nf = _("E469: invalid cscopequickfix flag %c for %c");
89 + char *buf = (char *)alloc((unsigned)strlen(nf));
91 + /* strlen will be enough because we use chars */
94 + sprintf(buf, nf, *qfpos, *(qfpos-1));
101 + # ifdef FEAT_AUTOCMD
104 + apply_autocmds(EVENT_QUICKFIXCMDPRE, (char_u *)"cscope",
105 + curbuf->b_fname, TRUE, curbuf);
107 + if (did_throw || force_abort)
115 /* create the actual command to send to cscope */
121 - /* get cmd letter */
149 - cmdletter = opt[0];
152 - qfpos = (char *)vim_strchr(p_csqf, cmdletter);
156 - /* next symbol must be + or - */
157 - if (strchr(CSQF_FLAGS, *qfpos) == NULL)
159 - char *nf = _("E469: invalid cscopequickfix flag %c for %c");
160 - char *buf = (char *)alloc((unsigned)strlen(nf));
162 - /* strlen will be enough because we use chars */
165 - sprintf(buf, nf, *qfpos, *(qfpos-1));
169 - vim_free(nummatches);
173 if (qfpos != NULL && *qfpos != '0' && totmatches > 0)
175 /* fill error list */
184 + # ifdef FEAT_AUTOCMD
185 + apply_autocmds(EVENT_QUICKFIXCMDPOST, (char_u *)"cscope",
186 + curbuf->b_fname, TRUE, curbuf);
190 * In the location list window, use the displayed location
191 *** ../vim-7.2.432/src/version.c 2010-05-14 22:24:31.000000000 +0200
192 --- src/version.c 2010-05-14 23:13:27.000000000 +0200
196 { /* Add new patch number below this line */
202 The 50-50-90 rule: Anytime you have a 50-50 chance of getting
203 something right, there's a 90% probability you'll get it wrong.
205 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
206 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
207 \\\ download, build and distribute -- http://www.A-A-P.org ///
208 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///