summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index aeb7774bf..f8795fa16 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -26,10 +26,12 @@ typedef struct ucmd
long_u uc_argt; /* The argument type */
char_u *uc_rep; /* The command's replacement string */
long uc_def; /* The default value for a range/count */
- scid_T uc_scriptID; /* SID where the command was defined */
int uc_compl; /* completion type */
-# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
+# ifdef FEAT_EVAL
+ scid_T uc_scriptID; /* SID where the command was defined */
+# ifdef FEAT_CMDL_COMPL
char_u *uc_compl_arg; /* completion argument if any */
+# endif
# endif
} ucmd_T;
@@ -3156,17 +3158,15 @@ set_one_cmd_context(xp, buff)
return NULL;
}
for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE;
- ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1))
- if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd, (size_t)len) == 0)
+ ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1))
+ if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd,
+ (size_t)len) == 0)
break;
#ifdef FEAT_USR_CMDS
if (cmd[0] >= 'A' && cmd[0] <= 'Z')
- {
while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */
++p;
- len = (int)(p - cmd);
- }
#endif
}
@@ -3809,6 +3809,9 @@ set_one_cmd_context(xp, buff)
set_context_in_profile_cmd(xp, arg);
break;
#endif
+ case CMD_behave:
+ xp->xp_context = EXPAND_BEHAVE;
+ break;
#endif /* FEAT_CMDL_COMPL */
@@ -10847,6 +10850,24 @@ ex_behave(eap)
EMSG2(_(e_invarg2), eap->arg);
}
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Function given to ExpandGeneric() to obtain the possible arguments of the
+ * ":behave {mswin,xterm}" command.
+ */
+ char_u *
+get_behave_arg(xp, idx)
+ expand_T *xp UNUSED;
+ int idx;
+{
+ if (idx == 0)
+ return (char_u *)"mswin";
+ if (idx == 1)
+ return (char_u *)"xterm";
+ return NULL;
+}
+#endif
+
#ifdef FEAT_AUTOCMD
static int filetype_detect = FALSE;
static int filetype_plugin = FALSE;