4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: No command line completion for ":profile".
12 Solution: Complete the subcommand and file name.
13 Files: src/ex_docmd.c, src/ex_cmds2.c, src/ex_getln.c,
14 src/proto/ex_cmds2.pro, src/vim.h
17 *** ../vim-7.2.352/src/ex_docmd.c 2009-11-03 12:38:50.000000000 +0100
18 --- src/ex_docmd.c 2010-02-03 14:40:14.000000000 +0100
22 xp->xp_context = EXPAND_NOTHING;
25 + #if defined(FEAT_PROFILE)
27 + set_context_in_profile_cmd(xp, arg);
31 #endif /* FEAT_CMDL_COMPL */
33 *** ../vim-7.2.352/src/ex_cmds2.c 2010-01-20 21:41:40.000000000 +0100
34 --- src/ex_cmds2.c 2010-02-03 14:50:08.000000000 +0100
41 + /* Command line expansion for :profile. */
44 + PEXP_SUBCMD, /* expand :profile sub-commands */
45 + PEXP_FUNC, /* expand :profile func {funcname} */
48 + static char *pexpand_cmds[] = {
50 + #define PROFCMD_START 0
52 + #define PROFCMD_PAUSE 1
54 + #define PROFCMD_CONTINUE 2
56 + #define PROFCMD_FUNC 3
58 + #define PROFCMD_FILE 4
60 + #define PROFCMD_LAST 5
64 + * Function given to ExpandGeneric() to obtain the profile command
65 + * specific expansion.
68 + get_profile_name(xp, idx)
69 + expand_T *xp UNUSED;
72 + switch (pexpand_what)
75 + return (char_u *)pexpand_cmds[idx];
76 + /* case PEXP_FUNC: TODO */
83 + * Handle command line completion for :profile command.
86 + set_context_in_profile_cmd(xp, arg)
93 + /* Default: expand subcommands. */
94 + xp->xp_context = EXPAND_PROFILE;
95 + pexpand_what = PEXP_SUBCMD;
96 + xp->xp_pattern = arg;
98 + end_subcmd = skiptowhite(arg);
99 + if (*end_subcmd == NUL)
102 + len = end_subcmd - arg;
103 + if (len == 5 && STRNCMP(arg, "start", 5) == 0)
105 + xp->xp_context = EXPAND_FILES;
106 + xp->xp_pattern = skipwhite(end_subcmd);
110 + /* TODO: expand function names after "func" */
111 + xp->xp_context = EXPAND_NOTHING;
115 * Dump the profiling info.
117 *** ../vim-7.2.352/src/ex_getln.c 2010-01-19 14:59:14.000000000 +0100
118 --- src/ex_getln.c 2010-02-03 14:38:43.000000000 +0100
123 {EXPAND_SIGN, get_sign_name, TRUE},
125 + #ifdef FEAT_PROFILE
126 + {EXPAND_PROFILE, get_profile_name, TRUE},
128 #if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
129 && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
130 {EXPAND_LANGUAGE, get_lang_arg, TRUE},
131 *** ../vim-7.2.352/src/proto/ex_cmds2.pro 2008-01-06 20:07:25.000000000 +0100
132 --- src/proto/ex_cmds2.pro 2010-02-03 14:43:12.000000000 +0100
136 int profile_equal __ARGS((proftime_T *tm1, proftime_T *tm2));
137 int profile_cmp __ARGS((proftime_T *tm1, proftime_T *tm2));
138 void ex_profile __ARGS((exarg_T *eap));
139 + char_u *get_profile_name __ARGS((expand_T *xp, int idx));
140 + void set_context_in_profile_cmd __ARGS((expand_T *xp, char_u *arg));
141 void profile_dump __ARGS((void));
142 void script_prof_save __ARGS((proftime_T *tm));
143 void script_prof_restore __ARGS((proftime_T *tm));
144 *** ../vim-7.2.352/src/vim.h 2009-06-16 11:08:13.000000000 +0200
145 --- src/vim.h 2010-02-03 14:40:42.000000000 +0100
149 #define EXPAND_SHELLCMD 32
150 #define EXPAND_CSCOPE 33
151 #define EXPAND_SIGN 34
152 + #define EXPAND_PROFILE 35
154 /* Values for exmode_active (0 is no exmode) */
155 #define EXMODE_NORMAL 1
156 *** ../vim-7.2.352/src/version.c 2010-02-03 12:23:16.000000000 +0100
157 --- src/version.c 2010-02-03 15:07:26.000000000 +0100
161 { /* Add new patch number below this line */
167 hundred-and-one symptoms of being an internet addict:
168 188. You purchase a laptop so you can surf while sitting on the can.
170 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
171 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
172 \\\ download, build and distribute -- http://www.A-A-P.org ///
173 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///