neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 5dd60e01ace2621f2307eebeb92e9e7351210d3a
parent 7ce27381fb49ac7d6ef1e115c3952f998e979b15
Author: Luuk van Baal <luukvbaal@gmail.com>
Date:   Thu, 16 Jan 2025 01:11:07 +0100

refactor(cmdline): more idiomatic way to avoid cmdline_show

Problem:  Fix applied in #32033 can be more idiomatic.
Solution: Unset redraw_state instead of cmdbuff.

Diffstat:
Msrc/nvim/ex_getln.c | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c @@ -951,10 +951,9 @@ theend: kv_destroy(ccline.last_colors.colors); char *p = ccline.cmdbuff; - // Prevent show events triggered by a (vim.ui_attach) hide callback. - ccline.cmdbuff = NULL; if (ui_has(kUICmdline)) { + ccline.redraw_state = kCmdRedrawNone; ui_call_cmdline_hide(ccline.level, s->gotesc); msg_ext_clear_later(); } @@ -967,6 +966,8 @@ theend: if (did_save_ccline) { restore_cmdline(&save_ccline); + } else { + ccline.cmdbuff = NULL; } return (uint8_t *)p; @@ -3415,10 +3416,6 @@ static void draw_cmdline(int start, int len) static void ui_ext_cmdline_show(CmdlineInfo *line) { - if (line->cmdbuff == NULL) { - return; - } - Arena arena = ARENA_EMPTY; Array content; if (cmdline_star) {