ext_cmdline: fix firstc, change cmdline_leave to cmdline_hide

This commit is contained in:
Dongdong Zhou
2017-05-11 04:48:59 +01:00
committed by Björn Linse
parent daec81ab51
commit e164ba41c8
3 changed files with 11 additions and 14 deletions

View File

@@ -1837,7 +1837,7 @@ getcmdline (
char_u *p = command_line_enter(firstc, count, indent);
if (ui_is_external(kUICmdline)) {
Array args = ARRAY_DICT_INIT;
ui_event("cmdline_leave", args);
ui_event("cmdline_hide", args);
}
return p;
}
@@ -2738,16 +2738,13 @@ void ui_ext_cmdline_show(void)
ADD(content, ARRAY_OBJ(text));
ADD(args, ARRAY_OBJ(content));
ADD(args, INTEGER_OBJ(ccline.cmdpos));
if (ccline.cmdfirstc != NUL) {
ADD(args, STRING_OBJ(cstr_to_string((char *)(&ccline.cmdfirstc))));
} else {
ADD(args, STRING_OBJ(cstr_to_string("")));
}
if (ccline.cmdprompt != NULL) {
ADD(args, STRING_OBJ(cstr_to_string((char *)(ccline.cmdprompt))));
} else {
ADD(args, STRING_OBJ(cstr_to_string("")));
}
char *firstc = (char []) { (char)ccline.cmdfirstc };
String str = (String) {
.data = xmemdupz(firstc, 1),
.size = 1
};
ADD(args, STRING_OBJ(str));
ADD(args, STRING_OBJ(cstr_to_string((char *)(ccline.cmdprompt))));
ui_event("cmdline_show", args);
}