diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-15 06:40:49 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-01-15 07:59:45 +0800 |
commit | 064fdad98c6eed5f42b72eeeb3efe458fefb377d (patch) | |
tree | f5e7e5b7e0ec6e4e0a5da3b38f5d759ff06c0c54 /src/nvim/profile.c | |
parent | f2056e4045a667447392f5e17c27b0f72ec7b8e0 (diff) | |
download | rneovim-064fdad98c6eed5f42b72eeeb3efe458fefb377d.tar.gz rneovim-064fdad98c6eed5f42b72eeeb3efe458fefb377d.tar.bz2 rneovim-064fdad98c6eed5f42b72eeeb3efe458fefb377d.zip |
vim-patch:8.2.4570: no command line completion for :profile and :profdel
Problem: No command line completion for :profile and :profdel.
Solution: Implement completion. (Yegappan Lakshmanan, closes vim/vim#9955)
https://github.com/vim/vim/commit/1fdf84e033f8c4eead3b4ccebb1969cfbc7d10db
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/profile.c')
-rw-r--r-- | src/nvim/profile.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/profile.c b/src/nvim/profile.c index 866834fc71..acbaf09a6e 100644 --- a/src/nvim/profile.c +++ b/src/nvim/profile.c @@ -354,7 +354,6 @@ char *get_profile_name(expand_T *xp, int idx) switch (pexpand_what) { case PEXP_SUBCMD: return pexpand_cmds[idx]; - // case PEXP_FUNC: TODO default: return NULL; } @@ -373,13 +372,17 @@ void set_context_in_profile_cmd(expand_T *xp, const char *arg) return; } - if (end_subcmd - arg == 5 && strncmp(arg, "start", 5) == 0) { + if ((end_subcmd - arg == 5 && strncmp(arg, "start", 5) == 0) + || (end_subcmd - arg == 4 && strncmp(arg, "file", 4) == 0)) { xp->xp_context = EXPAND_FILES; xp->xp_pattern = skipwhite(end_subcmd); return; + } else if (end_subcmd - arg == 4 && strncmp(arg, "func", 4) == 0) { + xp->xp_context = EXPAND_USER_FUNC; + xp->xp_pattern = skipwhite(end_subcmd); + return; } - // TODO(tarruda): expand function names after "func" xp->xp_context = EXPAND_NOTHING; } |