fix(messages): make swapfile attention message part of prompt (#34414)

Problem:  The swapfile attention message is not repeated after clearing
          the screen.
          After clearing the screen `msg_scrolled` is reset without
          clearing other related variables, causing an assert.
Solution: Make the attention message part of the confirm prompt.
          Call `msg_reset_scroll()`.
This commit is contained in:
luukvbaal
2025-06-12 11:57:17 +02:00
committed by GitHub
parent 221b6ddf1c
commit d86d4bacc1
33 changed files with 152 additions and 283 deletions

View File

@@ -255,7 +255,7 @@ void screenclear(void)
compute_cmdrow();
msg_row = cmdline_row; // put cursor on last line for messages
msg_col = 0;
msg_scrolled = 0; // can't scroll back
msg_reset_scroll(); // can't scroll back
msg_didany = false;
msg_didout = false;
if (HL_ATTR(HLF_MSG) > 0 && msg_use_grid() && msg_grid.chars) {
@@ -500,7 +500,7 @@ int update_screen(void)
}
// if the screen was scrolled up when displaying a message, scroll it down
if ((msg_scrolled || msg_grid_invalid) && !cmdline_number_prompt()) {
if (msg_scrolled || msg_grid_invalid) {
clear_cmdline = true;
int valid = MAX(Rows - msg_scrollsize(), 0);
if (msg_grid.chars) {