fix(ui): check for cmdline mode properly

Backport of #35202
This commit is contained in:
zeertzjq
2025-08-07 12:22:01 +08:00
parent 7f1e112a32
commit 6fd842a4fd
7 changed files with 28 additions and 9 deletions

View File

@@ -272,7 +272,7 @@ void screenclear(void)
/// to be re-emitted: avoid clearing the prompt from the message grid.
static bool cmdline_number_prompt(void)
{
return !ui_has(kUIMessages) && State == MODE_CMDLINE && get_cmdline_info()->mouse_used != NULL;
return !ui_has(kUIMessages) && (State & MODE_CMDLINE) && get_cmdline_info()->mouse_used != NULL;
}
/// Set dimensions of the Nvim application "screen".
@@ -374,8 +374,8 @@ void screen_resize(int width, int height)
// - in Ex mode, don't redraw anything.
// - Otherwise, redraw right now, and position the cursor.
if (State == MODE_ASKMORE || State == MODE_EXTERNCMD || exmode_active
|| (State == MODE_CMDLINE && get_cmdline_info()->one_key)) {
if (State == MODE_CMDLINE) {
|| ((State & MODE_CMDLINE) && get_cmdline_info()->one_key)) {
if (State & MODE_CMDLINE) {
update_screen();
}
if (msg_grid.chars) {