]> granicus.if.org Git - vim/commitdiff
updated for version 7.2-156 v7.2.156
authorBram Moolenaar <Bram@vim.org>
Wed, 22 Apr 2009 14:25:01 +0000 (14:25 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 22 Apr 2009 14:25:01 +0000 (14:25 +0000)
src/ex_docmd.c
src/if_cscope.c
src/proto/if_cscope.pro
src/version.c

index 057e7d6c300df534350028456b2ac355258b0e44..a6e6feac680cda1e76e47a118f99de8aa82c7d13 100644 (file)
@@ -3690,7 +3690,9 @@ set_one_cmd_context(xp, buff)
            break;
 #ifdef FEAT_CSCOPE
        case CMD_cscope:
-           set_context_in_cscope_cmd(xp, arg);
+       case CMD_lcscope:
+       case CMD_scscope:
+           set_context_in_cscope_cmd(xp, arg, ea.cmdidx);
            break;
 #endif
 #ifdef FEAT_LISTCMDS
index 2407ad03e34ed1760aea35b55d90f8f8b2efd709..1b0a8cdad2134c011137224e17e9a5aa5bfbf830 100644 (file)
@@ -98,6 +98,7 @@ cs_usage_msg(x)
 static enum
 {
     EXP_CSCOPE_SUBCMD, /* expand ":cscope" sub-commands */
+    EXP_SCSCOPE_SUBCMD,        /* expand ":scscope" sub-commands */
     EXP_CSCOPE_FIND,   /* expand ":cscope find" arguments */
     EXP_CSCOPE_KILL    /* expand ":cscope kill" arguments */
 } expand_what;
@@ -112,12 +113,23 @@ get_cscope_name(xp, idx)
     expand_T   *xp;
     int                idx;
 {
+    int                current_idx;
+    int                i;
+
     switch (expand_what)
     {
     case EXP_CSCOPE_SUBCMD:
        /* Complete with sub-commands of ":cscope":
         * add, find, help, kill, reset, show */
        return (char_u *)cs_cmds[idx].name;
+    case EXP_SCSCOPE_SUBCMD:
+       /* Complete with sub-commands of ":scscope": same sub-commands as
+        * ":cscope" but skip commands which don't support split windows */
+       for (i = 0, current_idx = 0; cs_cmds[i].name != NULL; i++)
+           if (cs_cmds[i].cansplit)
+               if (current_idx++ == idx)
+                   break;
+       return (char_u *)cs_cmds[i].name;
     case EXP_CSCOPE_FIND:
        {
            const char *query_type[] =
@@ -133,15 +145,13 @@ get_cscope_name(xp, idx)
        }
     case EXP_CSCOPE_KILL:
        {
-           int                 i;
-           int                 current_idx = 0;
            static char_u       connection[2];
 
            /* ":cscope kill" accepts connection numbers or partial names of
             * the pathname of the cscope database as argument.  Only complete
             * with connection numbers. -1 can also be used to kill all
             * connections. */
-           for (i = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
+           for (i = 0, current_idx = 0; i < CSCOPE_MAX_CONNECTIONS; i++)
            {
                if (csinfo[i].fname == NULL)
                    continue;
@@ -165,16 +175,18 @@ get_cscope_name(xp, idx)
  * Handle command line completion for :cscope command.
  */
     void
-set_context_in_cscope_cmd(xp, arg)
+set_context_in_cscope_cmd(xp, arg, cmdidx)
     expand_T   *xp;
     char_u     *arg;
+    cmdidx_T   cmdidx;
 {
     char_u     *p;
 
     /* Default: expand subcommands */
     xp->xp_context = EXPAND_CSCOPE;
-    expand_what = EXP_CSCOPE_SUBCMD;
     xp->xp_pattern = arg;
+    expand_what = (cmdidx == CMD_scscope)
+                       ? EXP_SCSCOPE_SUBCMD : EXP_CSCOPE_SUBCMD;
 
     /* (part of) subcommand already typed */
     if (*arg != NUL)
index 06885b2b6210b7d63d20a7701b15be8f99274db2..af2c076a335e0b102f2e4b35dc821f26b29dc75d 100644 (file)
@@ -1,6 +1,6 @@
 /* if_cscope.c */
 char_u *get_cscope_name __ARGS((expand_T *xp, int idx));
-void set_context_in_cscope_cmd __ARGS((expand_T *xp, char_u *arg));
+void set_context_in_cscope_cmd __ARGS((expand_T *xp, char_u *arg, cmdidx_T cmdidx));
 void do_cscope __ARGS((exarg_T *eap));
 void do_scscope __ARGS((exarg_T *eap));
 void do_cstag __ARGS((exarg_T *eap));
index 07ea2cfc025c65f23a0fa6f3959a500758d50111..220e2dfaf3058b00cbcf5632d24b7f0d6fbefc23 100644 (file)
@@ -676,6 +676,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    156,
 /**/
     155,
 /**/