Hi
Attached patch:
- adds command line completion to the ":behave {mswin,xterm}" command.
- puts field "uc_scriptID" in between #ifdef FEAT_EVAL in "struct ucmd"
since it's only used with FEAT_EVAL
- removes a useless statement "len = (int)(p - cmd);" in set_one_cmd_context()
- fixes a few typos in comments in vim.h
Cheers
-- Dominique
--
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
diff -r 4bac7ed34007 src/ex_docmd.c
--- a/src/ex_docmd.c Thu Feb 18 15:53:29 2010 +0100
+++ b/src/ex_docmd.c Sun Feb 21 19:15:41 2010 +0100
@@ -26,10 +26,12 @@
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 */
+ int uc_compl; /* completion type */
+# ifdef FEAT_EVAL
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_CMDL_COMPL
char_u *uc_compl_arg; /* completion argument if any */
+# endif
# endif
} ucmd_T;
@@ -3165,7 +3167,6 @@
{
while (ASCII_ISALNUM(*p) || *p == '*') /* Allow * wild card */
++p;
- len = (int)(p - cmd);
}
#endif
}
@@ -3809,6 +3810,9 @@
set_context_in_profile_cmd(xp, arg);
break;
#endif
+ case CMD_behave:
+ xp->xp_context = EXPAND_BEHAVE;
+ break;
#endif /* FEAT_CMDL_COMPL */
@@ -10821,6 +10825,8 @@
}
#endif
+
+
/*
* ":behave {mswin,xterm}"
*/
@@ -10847,6 +10853,24 @@
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;
diff -r 4bac7ed34007 src/ex_getln.c
--- a/src/ex_getln.c Thu Feb 18 15:53:29 2010 +0100
+++ b/src/ex_getln.c Sun Feb 21 19:15:41 2010 +0100
@@ -4492,6 +4492,7 @@
} tab[] =
{
{EXPAND_COMMANDS, get_command_name, FALSE},
+ {EXPAND_BEHAVE, get_behave_arg, TRUE},
#ifdef FEAT_USR_CMDS
{EXPAND_USER_COMMANDS, get_user_commands, FALSE},
{EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE},
diff -r 4bac7ed34007 src/proto/ex_docmd.pro
--- a/src/proto/ex_docmd.pro Thu Feb 18 15:53:29 2010 +0100
+++ b/src/proto/ex_docmd.pro Sun Feb 21 19:15:41 2010 +0100
@@ -52,4 +52,5 @@
int put_eol __ARGS((FILE *fd));
int put_line __ARGS((FILE *fd, char *s));
void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname));
+char_u *get_behave_arg __ARGS((expand_T *xp, int idx));
/* vim: set ft=c : */
diff -r 4bac7ed34007 src/vim.h
--- a/src/vim.h Thu Feb 18 15:53:29 2010 +0100
+++ b/src/vim.h Sun Feb 21 19:15:41 2010 +0100
@@ -593,7 +593,7 @@
/*
* Terminal highlighting attribute bits.
- * Attibutes above HL_ALL are used for syntax highlighting.
+ * Attributes above HL_ALL are used for syntax highlighting.
*/
#define HL_NORMAL 0x00
#define HL_INVERSE 0x01
@@ -719,6 +719,7 @@
#define EXPAND_CSCOPE 33
#define EXPAND_SIGN 34
#define EXPAND_PROFILE 35
+#define EXPAND_BEHAVE 36
/* Values for exmode_active (0 is no exmode) */
#define EXMODE_NORMAL 1
@@ -1260,7 +1261,7 @@
} hlf_T;
/* The HL_FLAGS must be in the same order as the HLF_ enums!
- * When chainging this also adjust the default for 'highlight'. */
+ * When changing this also adjust the default for 'highlight'. */
#define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
'f', 'F', 'A', 'C', 'D', 'T', '>', \
@@ -1428,7 +1429,7 @@
#ifdef FEAT_MBYTE
/* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
* encoding because mb_stricmp() takes care of all ascii and non-ascii
- * encodings, including characters with umluats in latin1, etc., while
+ * encodings, including characters with umlauts in latin1, etc., while
* STRICMP() only handles the system locale version, which often does not
* handle non-ascii properly. */