4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
10 Patch 7.2.156 (after 7.2.143)
11 Problem: No completion for :scscope and :lcscope commands.
12 Solution: Implement the completion. (Dominique Pelle)
13 Files: src/if_cscope.c, src/ex_docmd.c, src/proto/if_cscope.pro
16 *** ../vim-7.2.155/src/if_cscope.c Wed Mar 18 14:30:46 2009
17 --- src/if_cscope.c Wed Apr 22 11:57:49 2009
23 EXP_CSCOPE_SUBCMD, /* expand ":cscope" sub-commands */
24 + EXP_SCSCOPE_SUBCMD, /* expand ":scscope" sub-commands */
25 EXP_CSCOPE_FIND, /* expand ":cscope find" arguments */
26 EXP_CSCOPE_KILL /* expand ":cscope kill" arguments */
39 case EXP_CSCOPE_SUBCMD:
40 /* Complete with sub-commands of ":cscope":
41 * add, find, help, kill, reset, show */
42 return (char_u *)cs_cmds[idx].name;
43 + case EXP_SCSCOPE_SUBCMD:
44 + /* Complete with sub-commands of ":scscope": same sub-commands as
45 + * ":cscope" but skip commands which don't support split windows */
46 + for (i = 0, current_idx = 0; cs_cmds[i].name != NULL; i++)
47 + if (cs_cmds[i].cansplit)
48 + if (current_idx++ == idx)
50 + return (char_u *)cs_cmds[i].name;
53 const char *query_type[] =
60 - int current_idx = 0;
61 static char_u connection[2];
63 /* ":cscope kill" accepts connection numbers or partial names of
64 * the pathname of the cscope database as argument. Only complete
65 * with connection numbers. -1 can also be used to kill all
67 ! for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
69 if (csinfo[i].fname == NULL)
75 static char_u connection[2];
77 /* ":cscope kill" accepts connection numbers or partial names of
78 * the pathname of the cscope database as argument. Only complete
79 * with connection numbers. -1 can also be used to kill all
81 ! for (i = 0, current_idx = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
83 if (csinfo[i].fname == NULL)
87 * Handle command line completion for :cscope command.
90 ! set_context_in_cscope_cmd(xp, arg)
96 /* Default: expand subcommands */
97 xp->xp_context = EXPAND_CSCOPE;
98 - expand_what = EXP_CSCOPE_SUBCMD;
101 /* (part of) subcommand already typed */
104 * Handle command line completion for :cscope command.
107 ! set_context_in_cscope_cmd(xp, arg, cmdidx)
114 /* Default: expand subcommands */
115 xp->xp_context = EXPAND_CSCOPE;
116 xp->xp_pattern = arg;
117 + expand_what = (cmdidx == CMD_scscope)
118 + ? EXP_SCSCOPE_SUBCMD : EXP_CSCOPE_SUBCMD;
120 /* (part of) subcommand already typed */
122 *** ../vim-7.2.155/src/ex_docmd.c Wed Apr 22 14:42:26 2009
123 --- src/ex_docmd.c Wed Apr 22 11:57:49 2009
129 ! set_context_in_cscope_cmd(xp, arg);
139 ! set_context_in_cscope_cmd(xp, arg, ea.cmdidx);
143 *** ../vim-7.2.155/src/proto/if_cscope.pro Wed Mar 18 12:50:58 2009
144 --- src/proto/if_cscope.pro Wed Apr 22 11:57:49 2009
148 char_u *get_cscope_name __ARGS((expand_T *xp, int idx));
149 ! void set_context_in_cscope_cmd __ARGS((expand_T *xp, char_u *arg));
150 void do_cscope __ARGS((exarg_T *eap));
151 void do_scscope __ARGS((exarg_T *eap));
152 void do_cstag __ARGS((exarg_T *eap));
155 char_u *get_cscope_name __ARGS((expand_T *xp, int idx));
156 ! void set_context_in_cscope_cmd __ARGS((expand_T *xp, char_u *arg, cmdidx_T cmdidx));
157 void do_cscope __ARGS((exarg_T *eap));
158 void do_scscope __ARGS((exarg_T *eap));
159 void do_cstag __ARGS((exarg_T *eap));
160 *** ../vim-7.2.155/src/version.c Wed Apr 22 16:07:57 2009
161 --- src/version.c Wed Apr 22 16:21:43 2009
165 { /* Add new patch number below this line */
171 ARTHUR: Shut up! Will you shut up!
172 DENNIS: Ah, now we see the violence inherent in the system.
174 DENNIS: Oh! Come and see the violence inherent in the system!
175 HELP! HELP! I'm being repressed!
176 The Quest for the Holy Grail (Monty Python)
178 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
179 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
180 \\\ download, build and distribute -- http://www.A-A-P.org ///
181 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///