From d16bd456a8307158181a2aa659e5b78772f98cc5 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Fri, 22 May 2026 21:16:16 +0200 Subject: fix(cmdline): encode no prompt in cmdline_show.hl_id Problem: Unable to distinguish an empty prompt from no prompt in cmdline_show event. Solution: Set cmdline_show.hl_id to -1 when no prompt is active. --- src/nvim/ex_getln.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index ee79cd803f..dbbec988ce 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -3673,8 +3673,8 @@ static void ui_ext_cmdline_show(CmdlineInfo *line) char charbuf[2] = { (char)line->cmdfirstc, 0 }; ui_call_cmdline_show(content, line->cmdpos, cstr_as_string(charbuf), - cstr_as_string((line->cmdprompt)), - line->cmdindent, line->level, line->hl_id); + cstr_as_string(line->cmdprompt), + line->cmdindent, line->level, line->cmdprompt ? line->hl_id : -1); if (line->special_char) { charbuf[0] = line->special_char; ui_call_cmdline_special_char(cstr_as_string(charbuf), -- cgit