@@ -56,6 +56,7 @@ cmdline_fuzzy_completion_supported(expand_T *xp)
5656 && xp -> xp_context != EXPAND_OLD_SETTING
5757 && xp -> xp_context != EXPAND_OWNSYNTAX
5858 && xp -> xp_context != EXPAND_PACKADD
59+ && xp -> xp_context != EXPAND_RUNTIME
5960 && xp -> xp_context != EXPAND_SHELLCMD
6061 && xp -> xp_context != EXPAND_TAGS
6162 && xp -> xp_context != EXPAND_TAGS_LISTFILES
@@ -1366,6 +1367,7 @@ addstar(
13661367 || context == EXPAND_OWNSYNTAX
13671368 || context == EXPAND_FILETYPE
13681369 || context == EXPAND_PACKADD
1370+ || context == EXPAND_RUNTIME
13691371 || ((context == EXPAND_TAGS_LISTFILES
13701372 || context == EXPAND_TAGS )
13711373 && fname [0 ] == '/' ))
@@ -2335,6 +2337,10 @@ set_context_by_cmdname(
23352337 xp -> xp_pattern = arg ;
23362338 break ;
23372339
2340+ case CMD_runtime :
2341+ set_context_in_runtime_cmd (xp , arg );
2342+ break ;
2343+
23382344#if defined(HAVE_LOCALE_H ) || defined(X_LOCALE )
23392345 case CMD_language :
23402346 return set_context_in_lang_cmd (xp , arg );
@@ -3052,6 +3058,8 @@ ExpandFromContext(
30523058#endif
30533059 if (xp -> xp_context == EXPAND_PACKADD )
30543060 return ExpandPackAddDir (pat , numMatches , matches );
3061+ if (xp -> xp_context == EXPAND_RUNTIME )
3062+ return expand_runtime_cmd (pat , numMatches , matches );
30553063
30563064 // When expanding a function name starting with s:, match the <SNR>nr_
30573065 // prefix.
@@ -3611,13 +3619,15 @@ ExpandUserList(
36113619/*
36123620 * Expand "file" for all comma-separated directories in "path".
36133621 * Adds the matches to "ga". Caller must init "ga".
3622+ * If "dirs" is TRUE only expand directory names.
36143623 */
36153624 void
36163625globpath (
36173626 char_u * path ,
36183627 char_u * file ,
36193628 garray_T * ga ,
3620- int expand_options )
3629+ int expand_options ,
3630+ int dirs )
36213631{
36223632 expand_T xpc ;
36233633 char_u * buf ;
@@ -3630,7 +3640,7 @@ globpath(
36303640 return ;
36313641
36323642 ExpandInit (& xpc );
3633- xpc .xp_context = EXPAND_FILES ;
3643+ xpc .xp_context = dirs ? EXPAND_DIRECTORIES : EXPAND_FILES ;
36343644
36353645 // Loop over all entries in {path}.
36363646 while (* path != NUL )
@@ -4037,6 +4047,11 @@ f_getcompletion(typval_T *argvars, typval_T *rettv)
40374047 xpc .xp_pattern_len = (int )STRLEN (xpc .xp_pattern );
40384048 }
40394049# endif
4050+ if (xpc .xp_context == EXPAND_RUNTIME )
4051+ {
4052+ set_context_in_runtime_cmd (& xpc , xpc .xp_pattern );
4053+ xpc .xp_pattern_len = (int )STRLEN (xpc .xp_pattern );
4054+ }
40404055 }
40414056
40424057 if (cmdline_fuzzy_completion_supported (& xpc ))
0 commit comments