Merge branch 'master' into expression-parser

This commit is contained in:
ZyX
2017-11-06 20:23:35 +03:00
229 changed files with 2783 additions and 1244 deletions

View File

@@ -536,6 +536,9 @@ static int command_line_execute(VimState *state, int key)
if (!(s->c == p_wc && KeyTyped) && s->c != p_wcm
&& s->c != Ctrl_N && s->c != Ctrl_P && s->c != Ctrl_A
&& s->c != Ctrl_L) {
if (ui_is_external(kUIWildmenu)) {
ui_call_wildmenu_hide();
}
if (s->xpc.xp_numfiles != -1) {
(void)ExpandOne(&s->xpc, NULL, NULL, 0, WILD_FREE);
}
@@ -2836,7 +2839,7 @@ void ui_ext_cmdline_block_append(int indent, const char *line)
{
char *buf = xmallocz(indent + strlen(line));
memset(buf, ' ', indent);
memcpy(buf+indent, line, strlen(line));
memcpy(buf + indent, line, strlen(line)); // -V575
Array item = ARRAY_DICT_INIT;
ADD(item, DICTIONARY_OBJ((Dictionary)ARRAY_DICT_INIT));
@@ -3567,11 +3570,17 @@ ExpandOne (
else
findex = -1;
}
if (p_wmnu)
win_redr_status_matches(xp, xp->xp_numfiles, xp->xp_files,
findex, cmd_showtail);
if (findex == -1)
if (p_wmnu) {
if (ui_is_external(kUIWildmenu)) {
ui_call_wildmenu_select(findex);
} else {
win_redr_status_matches(xp, xp->xp_numfiles, xp->xp_files,
findex, cmd_showtail);
}
}
if (findex == -1) {
return vim_strsave(orig_save);
}
return vim_strsave(xp->xp_files[findex]);
} else
return NULL;
@@ -3928,6 +3937,15 @@ static int showmatches(expand_T *xp, int wildmenu)
showtail = cmd_showtail;
}
if (ui_is_external(kUIWildmenu)) {
Array args = ARRAY_DICT_INIT;
for (i = 0; i < num_files; i++) {
ADD(args, STRING_OBJ(cstr_to_string((char *)files_found[i])));
}
ui_call_wildmenu_show(args);
return EXPAND_OK;
}
if (!wildmenu) {
msg_didany = FALSE; /* lines_left will be set */
msg_start(); /* prepare for paging */
@@ -6180,4 +6198,3 @@ static void set_search_match(pos_T *t)
coladvance((colnr_T)MAXCOL);
}
}