]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1148 v7.3.1148
authorBram Moolenaar <Bram@vim.org>
Sat, 8 Jun 2013 13:24:48 +0000 (15:24 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 8 Jun 2013 13:24:48 +0000 (15:24 +0200)
Problem:    No command line completion for ":syntime".
Solution:   Implement the completion. (Dominique Pelle)

runtime/doc/map.txt
src/ex_cmds.h
src/ex_docmd.c
src/ex_getln.c
src/proto/syntax.pro
src/syntax.c
src/version.c
src/vim.h

index 039b77b36692883990f40a37b630daa9ca3e7d28..0ae0cf3e568c539c0933525b61917e7cacee936f 100644 (file)
@@ -1242,6 +1242,7 @@ completion can be enabled:
        -complete=shellcmd      Shell command
        -complete=sign          |:sign| suboptions
        -complete=syntax        syntax file names |'syntax'|
+       -complete=syntime       |:syntime| suboptions
        -complete=tag           tags
        -complete=tag_listfiles tags, file names are shown when CTRL-D is hit
        -complete=user          user names
index 19740884b4666deaeb4357df9c9aec8dd874159e..86bcead76af9849517fab8dcb734383fb5302b91 100644 (file)
@@ -926,7 +926,7 @@ EX(CMD_swapname,    "swapname",     ex_swapname,
 EX(CMD_syntax,         "syntax",       ex_syntax,
                        EXTRA|NOTRLCOM|CMDWIN),
 EX(CMD_syntime,                "syntime",      ex_syntime,
-                       WORD1|TRLBAR|CMDWIN),
+                       NEEDARG|WORD1|TRLBAR|CMDWIN),
 EX(CMD_syncbind,       "syncbind",     ex_syncbind,
                        TRLBAR),
 EX(CMD_t,              "t",            ex_copymove,
index 6b616ca8ab073936574775d8032de6f4b39ec09b..a8b0fb320a1fb725d350f3e305e6ebb8b60ad791 100644 (file)
@@ -3994,6 +3994,12 @@ set_one_cmd_context(xp, buff)
            xp->xp_pattern = arg;
            break;
 #endif
+#if defined(FEAT_PROFILE)
+       case CMD_syntime:
+           xp->xp_context = EXPAND_SYNTIME;
+           xp->xp_pattern = arg;
+           break;
+#endif
 
 #endif /* FEAT_CMDL_COMPL */
 
@@ -5436,6 +5442,9 @@ static struct
     {EXPAND_MAPPINGS, "mapping"},
     {EXPAND_MENUS, "menu"},
     {EXPAND_OWNSYNTAX, "syntax"},
+#if defined(FEAT_PROFILE)
+    {EXPAND_SYNTIME, "syntime"},
+#endif
     {EXPAND_SETTINGS, "option"},
     {EXPAND_SHELLCMD, "shellcmd"},
 #if defined(FEAT_SIGNS)
index 9fdb3771263c11192e74d75ef32fb91ab2114fb3..6fe91488c254b58488caacdc8ef8a9daef4a85ae 100644 (file)
@@ -4673,6 +4673,9 @@ ExpandFromContext(xp, pat, num_file, file, options)
 #endif
 #ifdef FEAT_SYN_HL
            {EXPAND_SYNTAX, get_syntax_name, TRUE, TRUE},
+#endif
+#ifdef FEAT_PROFILE
+           {EXPAND_SYNTIME, get_syntime_arg, TRUE, TRUE},
 #endif
            {EXPAND_HIGHLIGHT, get_highlight_name, TRUE, TRUE},
 #ifdef FEAT_AUTOCMD
index 2f57051ca971c7ec94bfc009ede8ecd5bd218e01..af81ac68e03f340aa266e7f0b594f140875739bb 100644 (file)
@@ -20,6 +20,7 @@ int syn_get_sub_char __ARGS((void));
 int syn_get_stack_item __ARGS((int i));
 int syn_get_foldlevel __ARGS((win_T *wp, long lnum));
 void ex_syntime __ARGS((exarg_T *eap));
+char_u *get_syntime_arg __ARGS((expand_T *xp, int idx));
 void init_highlight __ARGS((int both, int reset));
 int load_colors __ARGS((char_u *name));
 void do_highlight __ARGS((char_u *line, int forceit, int init));
index f2df13a3f0d69b1bedfa65b5f047f81b843898e5..323889ef8c265dfdb460898c8a3a4c78d06f15f0 100644 (file)
@@ -6577,6 +6577,27 @@ syntime_clear()
     }
 }
 
+#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
+/*
+ * Function given to ExpandGeneric() to obtain the possible arguments of the
+ * ":syntime {on,off,clear,report}" command.
+ */
+    char_u *
+get_syntime_arg(xp, idx)
+    expand_T   *xp UNUSED;
+    int                idx;
+{
+    switch (idx)
+    {
+       case 0: return (char_u *)"on";
+       case 1: return (char_u *)"off";
+       case 2: return (char_u *)"clear";
+       case 3: return (char_u *)"report";
+    }
+    return NULL;
+}
+#endif
+
 typedef struct
 {
     proftime_T total;
@@ -6610,7 +6631,9 @@ syntime_report()
 {
     int                idx;
     synpat_T   *spp;
+# ifdef FEAT_FLOAT
     proftime_T tm;
+# endif
     int                len;
     proftime_T total_total;
     int                total_count = 0;
index f83750188fca9540c8acbd75609eae6647f5e690..5ed91706491597b316e6963d67098a54b1daede1 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1148,
 /**/
     1147,
 /**/
index 5fb0481d57a57a955ed6e18b02dc032424f70feb..3f01ab737d56c303c36d20f1499e5ffb6852bd3e 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -783,6 +783,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname);
 #define EXPAND_LOCALES         40
 #define EXPAND_HISTORY         41
 #define EXPAND_USER            42
+#define EXPAND_SYNTIME         43
 
 /* Values for exmode_active (0 is no exmode) */
 #define EXMODE_NORMAL          1