mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
ext_cmdline: fix firstc, change cmdline_leave to cmdline_hide
This commit is contained in:
parent
daec81ab51
commit
e164ba41c8
@ -446,8 +446,8 @@ states might be represented as separate modes.
|
|||||||
["cmdline_enter"]
|
["cmdline_enter"]
|
||||||
Enter the cmdline.
|
Enter the cmdline.
|
||||||
|
|
||||||
["cmdline_leave"]
|
["cmdline_hide"]
|
||||||
Leave the cmdline.
|
Hide the cmdline.
|
||||||
|
|
||||||
["cmdline_show", content, pos, firstc, prompt]
|
["cmdline_show", content, pos, firstc, prompt]
|
||||||
content: List of [highlight group, string]
|
content: List of [highlight group, string]
|
||||||
|
@ -1837,7 +1837,7 @@ getcmdline (
|
|||||||
char_u *p = command_line_enter(firstc, count, indent);
|
char_u *p = command_line_enter(firstc, count, indent);
|
||||||
if (ui_is_external(kUICmdline)) {
|
if (ui_is_external(kUICmdline)) {
|
||||||
Array args = ARRAY_DICT_INIT;
|
Array args = ARRAY_DICT_INIT;
|
||||||
ui_event("cmdline_leave", args);
|
ui_event("cmdline_hide", args);
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
@ -2738,16 +2738,13 @@ void ui_ext_cmdline_show(void)
|
|||||||
ADD(content, ARRAY_OBJ(text));
|
ADD(content, ARRAY_OBJ(text));
|
||||||
ADD(args, ARRAY_OBJ(content));
|
ADD(args, ARRAY_OBJ(content));
|
||||||
ADD(args, INTEGER_OBJ(ccline.cmdpos));
|
ADD(args, INTEGER_OBJ(ccline.cmdpos));
|
||||||
if (ccline.cmdfirstc != NUL) {
|
char *firstc = (char []) { (char)ccline.cmdfirstc };
|
||||||
ADD(args, STRING_OBJ(cstr_to_string((char *)(&ccline.cmdfirstc))));
|
String str = (String) {
|
||||||
} else {
|
.data = xmemdupz(firstc, 1),
|
||||||
ADD(args, STRING_OBJ(cstr_to_string("")));
|
.size = 1
|
||||||
}
|
};
|
||||||
if (ccline.cmdprompt != NULL) {
|
ADD(args, STRING_OBJ(str));
|
||||||
ADD(args, STRING_OBJ(cstr_to_string((char *)(ccline.cmdprompt))));
|
ADD(args, STRING_OBJ(cstr_to_string((char *)(ccline.cmdprompt))));
|
||||||
} else {
|
|
||||||
ADD(args, STRING_OBJ(cstr_to_string("")));
|
|
||||||
}
|
|
||||||
ui_event("cmdline_show", args);
|
ui_event("cmdline_show", args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ describe('External command line completion', function()
|
|||||||
screen:set_on_event_handler(function(name, data)
|
screen:set_on_event_handler(function(name, data)
|
||||||
if name == "cmdline_enter" then
|
if name == "cmdline_enter" then
|
||||||
shown = true
|
shown = true
|
||||||
elseif name == "cmdline_leave" then
|
elseif name == "cmdline_hide" then
|
||||||
shown = false
|
shown = false
|
||||||
elseif name == "cmdline_show" then
|
elseif name == "cmdline_show" then
|
||||||
content, pos, firstc, prompt = unpack(data)
|
content, pos, firstc, prompt = unpack(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user