Hi
Attached patch adds completion to the :ownsyntax Ex command.
Example:
:ownsyntax java<Tab>
java javacc javascript
Regards
-- Dominique
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff -r b7cb69ab616d src/ex_docmd.c
--- a/src/ex_docmd.c Sun Jun 13 05:20:42 2010 +0200
+++ b/src/ex_docmd.c Sun Jun 20 17:19:01 2010 +0200
@@ -3803,6 +3803,11 @@
xp->xp_pattern = arg;
break;
+ case CMD_ownsyntax:
+ xp->xp_context = EXPAND_FILETYPE;
+ xp->xp_pattern = arg;
+ break;
+
#if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
&& (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
case CMD_language:
diff -r b7cb69ab616d src/ex_getln.c
--- a/src/ex_getln.c Sun Jun 13 05:20:42 2010 +0200
+++ b/src/ex_getln.c Sun Jun 20 17:19:01 2010 +0200
@@ -4108,6 +4108,7 @@
if (context == EXPAND_HELP
|| context == EXPAND_COLORS
|| context == EXPAND_COMPILER
+ || context == EXPAND_FILETYPE
|| (context == EXPAND_TAGS && fname[0] == '/'))
retval = vim_strnsave(fname, len);
else
@@ -4489,6 +4490,8 @@
return ExpandRTDir(pat, num_file, file, "colors");
if (xp->xp_context == EXPAND_COMPILER)
return ExpandRTDir(pat, num_file, file, "compiler");
+ if (xp->xp_context == EXPAND_FILETYPE)
+ return ExpandRTDir(pat, num_file, file, "syntax");
# if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
if (xp->xp_context == EXPAND_USER_LIST)
return ExpandUserList(xp, num_file, file);
@@ -4928,15 +4931,15 @@
#endif
/*
- * Expand color scheme names: 'runtimepath'/colors/{pat}.vim
- * or compiler names.
+ * Expand color scheme, compiler or filetype names:
+ * 'runtimepath'/{dirname}/{pat}.vim
*/
static int
ExpandRTDir(pat, num_file, file, dirname)
char_u *pat;
int *num_file;
char_u ***file;
- char *dirname; /* "colors" or "compiler" */
+ char *dirname; /* "colors", "compiler" or "syntax" */
{
char_u *all;
char_u *s;
diff -r b7cb69ab616d src/vim.h
--- a/src/vim.h Sun Jun 13 05:20:42 2010 +0200
+++ b/src/vim.h Sun Jun 20 17:19:01 2010 +0200
@@ -769,6 +769,7 @@
#define EXPAND_SIGN 34
#define EXPAND_PROFILE 35
#define EXPAND_BEHAVE 36
+#define EXPAND_FILETYPE 37
/* Values for exmode_active (0 is no exmode) */
#define EXMODE_NORMAL 1
@@ -1556,7 +1557,7 @@
/*
* Well, you won't believe it, but some S/390 machines ("host", now also known
- * as zServer) us 31 bit pointers. There are also some newer machines, that
+ * as zServer) use 31 bit pointers. There are also some newer machines, that
* use 64 bit pointers. I don't know how to distinguish between 31 and 64 bit
* machines, so the best way is to assume 31 bits whenever we detect OS/390
* Unix.