1
0
forked from aniani/vim

patch 9.0.0294: crash when 'cmdheight' is 0 and popup_clear() used

Problem:    Crash when 'cmdheight' is 0 and popup_clear() used.
Solution:   Reset "message_win" when the message popup is cleared.  Close the
            popup when 'cmdheight' is non-zero.  Add a screendump test.
This commit is contained in:
Bram Moolenaar
2022-08-28 13:02:45 +01:00
parent b0509c542e
commit 43568648df
8 changed files with 74 additions and 3 deletions

View File

@@ -28,6 +28,11 @@ static poppos_entry_T poppos_entries[] = {
{"center", POPPOS_CENTER}
};
#ifdef HAS_MESSAGE_WINDOW
// Window used for messages when 'winheight' is zero.
static win_T *message_win = NULL;
#endif
static void popup_adjust_position(win_T *wp);
/*
@@ -2770,6 +2775,11 @@ popup_free(win_T *wp)
clear_cmdline = TRUE;
win_free_popup(wp);
#ifdef HAS_MESSAGE_WINDOW
if (wp == message_win)
message_win = NULL;
#endif
redraw_all_later(UPD_NOT_VALID);
popup_mask_refresh = TRUE;
}
@@ -4440,9 +4450,6 @@ popup_close_info(void)
#if defined(HAS_MESSAGE_WINDOW) || defined(PROTO)
// Window used for messages when 'winheight' is zero.
static win_T *message_win = NULL;
/*
* Get the message window.
* Returns NULL if something failed.
@@ -4516,6 +4523,16 @@ popup_hide_message_win(void)
popup_hide(message_win);
}
/*
* If the message window exists: close it.
*/
void
popup_close_message_win(void)
{
if (message_win != NULL)
popup_close(message_win->w_id, TRUE);
}
#endif
/*