Merge #5418 from Shougo/vim-7.4.2158

vim-patch: 7.4.2158, 2162, 2205
This commit is contained in:
Justin M. Keyes
2016-10-13 00:44:18 +02:00
committed by GitHub
5 changed files with 61 additions and 12 deletions

View File

@@ -9648,13 +9648,23 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
char_u *pat;
expand_T xpc;
bool filtered = false;
int options = WILD_SILENT | WILD_USE_NL | WILD_ADD_SLASH
| WILD_NO_BEEP;
if (argvars[2].v_type != VAR_UNKNOWN) {
filtered = get_tv_number_chk(&argvars[2], NULL);
}
if (p_wic) {
options |= WILD_ICASE;
}
// For filtered results, 'wildignore' is used
if (!filtered) {
options |= WILD_KEEP_ALL;
}
ExpandInit(&xpc);
xpc.xp_pattern = get_tv_string(&argvars[0]);
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
@@ -9673,6 +9683,16 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr)
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
}
if (xpc.xp_context == EXPAND_CSCOPE) {
set_context_in_cscope_cmd(&xpc, xpc.xp_pattern, CMD_cscope);
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
}
if (xpc.xp_context == EXPAND_SIGN) {
set_context_in_sign_cmd(&xpc, xpc.xp_pattern);
xpc.xp_pattern_len = STRLEN(xpc.xp_pattern);
}
pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context);
rettv_list_alloc(rettv);
if (pat != NULL) {