diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2022-03-15 10:53:09 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-03-15 10:53:09 +0000 |
commit | 1fdf84e033f8c4eead3b4ccebb1969cfbc7d10db (patch) | |
tree | 6ed313f31160373533389e95b6bc8e0a55971ec1 /src/cmdexpand.c | |
parent | 977525fea662b7f37ad0e052894c1f62b5b03269 (diff) | |
download | vim-git-1fdf84e033f8c4eead3b4ccebb1969cfbc7d10db.tar.gz |
patch 8.2.4570: no command line completion for :profile and :profdelv8.2.4570
Problem: No command line completion for :profile and :profdel.
Solution: Implement completion. (Yegappan Lakshmanan, closes #9955)
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r-- | src/cmdexpand.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c index 7ab1bba31..c408bd099 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -1606,7 +1606,8 @@ set_context_in_lang_cmd(expand_T *xp, char_u *arg) static enum { EXP_BREAKPT_ADD, // expand ":breakadd" sub-commands - EXP_BREAKPT_DEL // expand ":breakdel" sub-commands + EXP_BREAKPT_DEL, // expand ":breakdel" sub-commands + EXP_PROFDEL // expand ":profdel" sub-commands } breakpt_expand_what; /* @@ -1623,16 +1624,17 @@ set_context_in_breakadd_cmd(expand_T *xp, char_u *arg, cmdidx_T cmdidx) if (cmdidx == CMD_breakadd) breakpt_expand_what = EXP_BREAKPT_ADD; - else + else if (cmdidx == CMD_breakdel) breakpt_expand_what = EXP_BREAKPT_DEL; + else + breakpt_expand_what = EXP_PROFDEL; p = skipwhite(arg); if (*p == NUL) return NULL; subcmd_start = p; - if (STRNCMP("file ", p, 5) == 0 || - STRNCMP("func ", p, 5) == 0) + if (STRNCMP("file ", p, 5) == 0 || STRNCMP("func ", p, 5) == 0) { // :breakadd file [lnum] <filename> // :breakadd func [lnum] <funcname> @@ -2025,6 +2027,7 @@ set_context_by_cmdname( #ifdef FEAT_EVAL case CMD_breakadd: + case CMD_profdel: case CMD_breakdel: return set_context_in_breakadd_cmd(xp, arg, cmdidx); #endif @@ -2432,13 +2435,21 @@ get_breakadd_arg(expand_T *xp UNUSED, int idx) if (idx >=0 && idx <= 3) { + // breakadd {expr, file, func, here} if (breakpt_expand_what == EXP_BREAKPT_ADD) return (char_u *)opts[idx]; - else + else if (breakpt_expand_what == EXP_BREAKPT_DEL) { + // breakdel {func, file, here} if (idx <= 2) return (char_u *)opts[idx + 1]; } + else + { + // profdel {func, file} + if (idx <= 1) + return (char_u *)opts[idx + 1]; + } } return NULL; } |