aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2024-12-20 21:11:38 +0100
committerLuuk van Baal <luukvbaal@gmail.com>2024-12-22 15:23:43 +0100
commit394f69a25dc32c5b101ba2d34ac6376b0c75b2a2 (patch)
tree8609bdc18c695c585a65a3c7733830ad87fa5a2d /src
parente1c2179dd93ed2cd787b1cd016606b1901a1acfe (diff)
downloadrneovim-394f69a25dc32c5b101ba2d34ac6376b0c75b2a2.tar.gz
rneovim-394f69a25dc32c5b101ba2d34ac6376b0c75b2a2.tar.bz2
rneovim-394f69a25dc32c5b101ba2d34ac6376b0c75b2a2.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/ui_events.in.h4
-rw-r--r--src/nvim/ex_getln.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/src/nvim/api/ui_events.in.h b/src/nvim/api/ui_events.in.h
index 0ed208fc1a..603f9b2005 100644
--- a/src/nvim/api/ui_events.in.h
+++ b/src/nvim/api/ui_events.in.h
@@ -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;
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 2c1653006c..b134a899c9 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -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);