@@ -0,0 +1,208 @@
|
|
1
|
+
To: vim-dev@vim.org
|
2
|
+
Subject: Patch 7.2.433
|
3
|
+
Fcc: outbox
|
4
|
+
From: Bram Moolenaar <Bram@moolenaar.net>
|
5
|
+
Mime-Version: 1.0
|
6
|
+
Content-Type: text/plain; charset=UTF-8
|
7
|
+
Content-Transfer-Encoding: 8bit
|
8
|
+
------------
|
9
|
+
|
10
|
+
Patch 7.2.433
|
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
|
14
|
+
|
15
|
+
|
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
|
18
|
+
***************
|
19
|
+
*** 678,687 ****
|
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
|
30
|
+
--- 678,687 ----
|
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
|
43
|
+
***************
|
44
|
+
*** 1113,1118 ****
|
45
|
+
--- 1113,1182 ----
|
46
|
+
#ifdef FEAT_QUICKFIX
|
47
|
+
char cmdletter;
|
48
|
+
char *qfpos;
|
49
|
+
+
|
50
|
+
+ /* get cmd letter */
|
51
|
+
+ switch (opt[0])
|
52
|
+
+ {
|
53
|
+
+ case '0' :
|
54
|
+
+ cmdletter = 's';
|
55
|
+
+ break;
|
56
|
+
+ case '1' :
|
57
|
+
+ cmdletter = 'g';
|
58
|
+
+ break;
|
59
|
+
+ case '2' :
|
60
|
+
+ cmdletter = 'd';
|
61
|
+
+ break;
|
62
|
+
+ case '3' :
|
63
|
+
+ cmdletter = 'c';
|
64
|
+
+ break;
|
65
|
+
+ case '4' :
|
66
|
+
+ cmdletter = 't';
|
67
|
+
+ break;
|
68
|
+
+ case '6' :
|
69
|
+
+ cmdletter = 'e';
|
70
|
+
+ break;
|
71
|
+
+ case '7' :
|
72
|
+
+ cmdletter = 'f';
|
73
|
+
+ break;
|
74
|
+
+ case '8' :
|
75
|
+
+ cmdletter = 'i';
|
76
|
+
+ break;
|
77
|
+
+ default :
|
78
|
+
+ cmdletter = opt[0];
|
79
|
+
+ }
|
80
|
+
+
|
81
|
+
+ qfpos = (char *)vim_strchr(p_csqf, cmdletter);
|
82
|
+
+ if (qfpos != NULL)
|
83
|
+
+ {
|
84
|
+
+ qfpos++;
|
85
|
+
+ /* next symbol must be + or - */
|
86
|
+
+ if (strchr(CSQF_FLAGS, *qfpos) == NULL)
|
87
|
+
+ {
|
88
|
+
+ char *nf = _("E469: invalid cscopequickfix flag %c for %c");
|
89
|
+
+ char *buf = (char *)alloc((unsigned)strlen(nf));
|
90
|
+
+
|
91
|
+
+ /* strlen will be enough because we use chars */
|
92
|
+
+ if (buf != NULL)
|
93
|
+
+ {
|
94
|
+
+ sprintf(buf, nf, *qfpos, *(qfpos-1));
|
95
|
+
+ (void)EMSG(buf);
|
96
|
+
+ vim_free(buf);
|
97
|
+
+ }
|
98
|
+
+ return FALSE;
|
99
|
+
+ }
|
100
|
+
+
|
101
|
+
+ # ifdef FEAT_AUTOCMD
|
102
|
+
+ if (*qfpos != '0')
|
103
|
+
+ {
|
104
|
+
+ apply_autocmds(EVENT_QUICKFIXCMDPRE, (char_u *)"cscope",
|
105
|
+
+ curbuf->b_fname, TRUE, curbuf);
|
106
|
+
+ # ifdef FEAT_EVAL
|
107
|
+
+ if (did_throw || force_abort)
|
108
|
+
+ return FALSE;
|
109
|
+
+ # endif
|
110
|
+
+ }
|
111
|
+
+ # endif
|
112
|
+
+ }
|
113
|
+
#endif
|
114
|
+
|
115
|
+
/* create the actual command to send to cscope */
|
116
|
+
***************
|
117
|
+
*** 1174,1231 ****
|
118
|
+
}
|
119
|
+
|
120
|
+
#ifdef FEAT_QUICKFIX
|
121
|
+
- /* get cmd letter */
|
122
|
+
- switch (opt[0])
|
123
|
+
- {
|
124
|
+
- case '0' :
|
125
|
+
- cmdletter = 's';
|
126
|
+
- break;
|
127
|
+
- case '1' :
|
128
|
+
- cmdletter = 'g';
|
129
|
+
- break;
|
130
|
+
- case '2' :
|
131
|
+
- cmdletter = 'd';
|
132
|
+
- break;
|
133
|
+
- case '3' :
|
134
|
+
- cmdletter = 'c';
|
135
|
+
- break;
|
136
|
+
- case '4' :
|
137
|
+
- cmdletter = 't';
|
138
|
+
- break;
|
139
|
+
- case '6' :
|
140
|
+
- cmdletter = 'e';
|
141
|
+
- break;
|
142
|
+
- case '7' :
|
143
|
+
- cmdletter = 'f';
|
144
|
+
- break;
|
145
|
+
- case '8' :
|
146
|
+
- cmdletter = 'i';
|
147
|
+
- break;
|
148
|
+
- default :
|
149
|
+
- cmdletter = opt[0];
|
150
|
+
- }
|
151
|
+
-
|
152
|
+
- qfpos = (char *)vim_strchr(p_csqf, cmdletter);
|
153
|
+
- if (qfpos != NULL)
|
154
|
+
- {
|
155
|
+
- qfpos++;
|
156
|
+
- /* next symbol must be + or - */
|
157
|
+
- if (strchr(CSQF_FLAGS, *qfpos) == NULL)
|
158
|
+
- {
|
159
|
+
- char *nf = _("E469: invalid cscopequickfix flag %c for %c");
|
160
|
+
- char *buf = (char *)alloc((unsigned)strlen(nf));
|
161
|
+
-
|
162
|
+
- /* strlen will be enough because we use chars */
|
163
|
+
- if (buf != NULL)
|
164
|
+
- {
|
165
|
+
- sprintf(buf, nf, *qfpos, *(qfpos-1));
|
166
|
+
- (void)EMSG(buf);
|
167
|
+
- vim_free(buf);
|
168
|
+
- }
|
169
|
+
- vim_free(nummatches);
|
170
|
+
- return FALSE;
|
171
|
+
- }
|
172
|
+
- }
|
173
|
+
if (qfpos != NULL && *qfpos != '0' && totmatches > 0)
|
174
|
+
{
|
175
|
+
/* fill error list */
|
176
|
+
--- 1238,1243 ----
|
177
|
+
***************
|
178
|
+
*** 1258,1263 ****
|
179
|
+
--- 1270,1280 ----
|
180
|
+
postponed_split = 0;
|
181
|
+
}
|
182
|
+
# endif
|
183
|
+
+
|
184
|
+
+ # ifdef FEAT_AUTOCMD
|
185
|
+
+ apply_autocmds(EVENT_QUICKFIXCMDPOST, (char_u *)"cscope",
|
186
|
+
+ curbuf->b_fname, TRUE, curbuf);
|
187
|
+
+ # endif
|
188
|
+
if (use_ll)
|
189
|
+
/*
|
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
|
193
|
+
***************
|
194
|
+
*** 683,684 ****
|
195
|
+
--- 683,686 ----
|
196
|
+
{ /* Add new patch number below this line */
|
197
|
+
+ /**/
|
198
|
+
+ 433,
|
199
|
+
/**/
|
200
|
+
|
201
|
+
--
|
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.
|
204
|
+
|
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 ///
|