fix(ui): check for cmdline mode properly (#35202)

This commit is contained in:
zeertzjq
2025-08-07 12:22:01 +08:00
committed by GitHub
parent c47a69c1a6
commit 5f9f706462
8 changed files with 31 additions and 12 deletions

View File

@@ -270,7 +270,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".
@@ -372,8 +372,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) {