aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-11-06 20:23:35 +0300
committerZyX <kp-pav@yandex.ru>2017-11-06 20:23:35 +0300
commit24a353364d6d186d528009fd0bb603d87183cf35 (patch)
treea4070dc00731475d6bbdd3c84e61806b33802f7a /src/nvim/ex_getln.c
parentf2660bee6aca35be3d0ddb1d225784476c13cd27 (diff)
parent946c2a8ee85830c543e389724575ae531e89b170 (diff)
downloadrneovim-24a353364d6d186d528009fd0bb603d87183cf35.tar.gz
rneovim-24a353364d6d186d528009fd0bb603d87183cf35.tar.bz2
rneovim-24a353364d6d186d528009fd0bb603d87183cf35.zip
Merge branch 'master' into expression-parser
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 3b751530e8..e6fb2571c4 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -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);
}
}
-