patch 9.1.1563: completion: ruler may disappear

Problem:  The ruler disappears after typing the second character during
          insert mode completion, even when completion messages are
          suppressed ('shortmess' includes "c"). This makes the UI
          appear inconsistent.
Solution: Ensure the ruler is restored during screen redraw when popup
          completion is active (Girish Palya).

Notes:
No new tests were added, as existing screen dump tests were updated to
reflect the corrected behavior.

closes: #17770

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Girish Palya
2025-07-17 22:02:57 +02:00
committed by Christian Brabandt
parent fb45809f01
commit 824286c9a7
7 changed files with 101 additions and 95 deletions

View File

@ -4051,6 +4051,7 @@ showmode(void)
int attr;
int nwr_save;
int sub_attr;
int show_ruler_with_pum = FALSE;
do_mode = p_smd && msg_silent == 0
&& ((State & MODE_INSERT)
@ -4182,6 +4183,10 @@ showmode(void)
msg_puts_attr(_(p), attr);
}
msg_puts_attr(" --", attr);
// Ensure ruler is shown when a popup is visible and only the mode name
// is displayed. Without this, the ruler may disappear during insert-mode
// completion when 'shortmess' includes 'c'.
show_ruler_with_pum = TRUE;
}
need_clear = TRUE;
@ -4217,7 +4222,7 @@ showmode(void)
// If the last window has no status line, the ruler is after the mode
// message and must be redrawn
if (redrawing() && lastwin->w_status_height == 0)
win_redr_ruler(lastwin, TRUE, FALSE);
win_redr_ruler(lastwin, TRUE, show_ruler_with_pum);
redraw_cmdline = FALSE;
redraw_mode = FALSE;