diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-21 07:29:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-21 07:29:49 +0800 |
commit | 694814cdd54ac245d1f4d2c28dce7e9132fcb616 (patch) | |
tree | 70258002f855c8b921998bc1d90b992840dc5a1f /src/nvim/usercmd.c | |
parent | ac99e63d73df84cc20766ad86655724f3a0345b9 (diff) | |
download | rneovim-694814cdd54ac245d1f4d2c28dce7e9132fcb616.tar.gz rneovim-694814cdd54ac245d1f4d2c28dce7e9132fcb616.tar.bz2 rneovim-694814cdd54ac245d1f4d2c28dce7e9132fcb616.zip |
vim-patch:9.0.1774: no support for custom cmdline completion (#24808)
Problem: no support for custom cmdline completion
Solution: Add new vimscript functions
Add the following two functions:
- getcmdcompltype() returns custom and customlist functions
- getcompletion() supports both custom and customlist
closes: vim/vim#12228
https://github.com/vim/vim/commit/92997dda789ad8061841128cbc99b15ec0374411
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Diffstat (limited to 'src/nvim/usercmd.c')
-rw-r--r-- | src/nvim/usercmd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/usercmd.c b/src/nvim/usercmd.c index 65720342ce..e585818e75 100644 --- a/src/nvim/usercmd.c +++ b/src/nvim/usercmd.c @@ -425,6 +425,13 @@ char *get_user_cmd_complete(expand_T *xp, int idx) int cmdcomplete_str_to_type(const char *complete_str) { + if (strncmp(complete_str, "custom,", 7) == 0) { + return EXPAND_USER_DEFINED; + } + if (strncmp(complete_str, "customlist,", 11) == 0) { + return EXPAND_USER_LIST; + } + for (int i = 0; i < (int)(ARRAY_SIZE(command_complete)); i++) { char *cmd_compl = get_command_complete(i); if (cmd_compl == NULL) { |