mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
feat(ui): additional arguments for cmdline_show/hide events
Problem: Unable to tell what highlight the prompt part of a cmdline_show event should have, and whether cmdline_hide was emitted after aborting. Solution: Add additional arguments hl_id to cmdline_show, and abort to cmdline_hide.
This commit is contained in:
@@ -136,13 +136,13 @@ void tabline_update(Tabpage current, Array tabs, Buffer current_buffer, Array bu
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
|
||||
void cmdline_show(Array content, Integer pos, String firstc, String prompt, Integer indent,
|
||||
Integer level)
|
||||
Integer level, Integer hl_id)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_pos(Integer pos, Integer level)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_special_char(String c, Boolean shift, Integer level)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_hide(Integer level)
|
||||
void cmdline_hide(Integer level, Boolean abort)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
void cmdline_block_show(Array lines)
|
||||
FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY;
|
||||
|
@@ -956,7 +956,7 @@ theend:
|
||||
char *p = ccline.cmdbuff;
|
||||
|
||||
if (ui_has(kUICmdline)) {
|
||||
ui_call_cmdline_hide(ccline.level);
|
||||
ui_call_cmdline_hide(ccline.level, s->gotesc);
|
||||
msg_ext_clear_later();
|
||||
}
|
||||
if (!cmd_silent) {
|
||||
@@ -3422,8 +3422,7 @@ static void ui_ext_cmdline_show(CmdlineInfo *line)
|
||||
ui_call_cmdline_show(content, line->cmdpos,
|
||||
cstr_as_string(charbuf),
|
||||
cstr_as_string((line->cmdprompt)),
|
||||
line->cmdindent,
|
||||
line->level);
|
||||
line->cmdindent, line->level, line->hl_id);
|
||||
if (line->special_char) {
|
||||
charbuf[0] = line->special_char;
|
||||
ui_call_cmdline_special_char(cstr_as_string(charbuf),
|
||||
@@ -4477,7 +4476,7 @@ static int open_cmdwin(void)
|
||||
invalidate_botline(curwin);
|
||||
if (ui_has(kUICmdline)) {
|
||||
ccline.redraw_state = kCmdRedrawNone;
|
||||
ui_call_cmdline_hide(ccline.level);
|
||||
ui_call_cmdline_hide(ccline.level, false);
|
||||
}
|
||||
redraw_later(curwin, UPD_SOME_VALID);
|
||||
|
||||
|
Reference in New Issue
Block a user