Mercurial > vim
diff src/usercmd.c @ 32947:306f51627f50 v9.0.1774
commit 92997dda789ad8061841128cbc99b15ec0374411
Author: Shougo Matsushita <Shougo.Matsu@gmail.com>
Date: Sun Aug 20 20:55:55 2023 +0200
patch 9.0.1774: no support for custom cmdline completion
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: #12228
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 20 Aug 2023 22:11:05 +0200 |
parents | e98fc0c439aa |
children | 7c30841c60a0 |
line wrap: on
line diff
--- a/src/usercmd.c +++ b/src/usercmd.c @@ -481,6 +481,11 @@ cmdcomplete_str_to_type(char_u *complete { int i; + if (STRNCMP(complete_str, "custom,", 7) == 0) + return EXPAND_USER_DEFINED; + if (STRNCMP(complete_str, "customlist,", 11) == 0) + return EXPAND_USER_LIST; + for (i = 0; command_complete[i].expand != 0; ++i) if (STRCMP(complete_str, command_complete[i].name) == 0) return command_complete[i].expand;