From 23f591dba078fee16ab6e4debfcd051e799ca4f8 Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Sat, 23 Jul 2016 11:33:38 +0900 Subject: [RFC] vim-patch:7.4.2011, vim-patch:7.4.2012, vim-patch:7.4.2066 #5106 vim-patch:7.4.2011 Problem: It is not easy to get a list of command arguments. Solution: Add getcompletion(). (Yegappan Lakshmanan) https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7 vim-patch:7.4.2012 Problem: Test for getcompletion() does not pass on all systems. Solution: Only test what is supported. https://github.com/vim/vim/commit/0d3e24be5686c0710aa3c6671e4c626d6cb21a5f vim-patch:7.4.2066 Problem: getcompletion() not well tested. Solution: Add more testing. https://github.com/vim/vim/commit/c1fb763184c8ae82300357867fa2070aa94366e9 --- src/nvim/ex_docmd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 9bc7ec39da..8bae817211 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -5597,6 +5597,17 @@ int parse_compl_arg(char_u *value, int vallen, int *complp, return OK; } +int cmdcomplete_str_to_type(char_u *complete_str) +{ + for (int i = 0; command_complete[i].expand != 0; i++) { + if (STRCMP(complete_str, command_complete[i].name) == 0) { + return command_complete[i].expand; + } + } + + return EXPAND_NOTHING; +} + static void ex_colorscheme(exarg_T *eap) { if (*eap->arg == NUL) { -- cgit