if (type != UPD_CLEAR)
{
if (msg_scrolled > Rows - 5) // redrawing is faster
+ {
type = UPD_NOT_VALID;
+ redraw_as_cleared();
+ }
else
{
check_for_delay(FALSE);
if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, 0, NULL)
== FAIL)
+ {
type = UPD_NOT_VALID;
+ redraw_as_cleared();
+ }
FOR_ALL_WINDOWS(wp)
{
if (wp->w_winrow < msg_scrolled)
}
#endif
+/*
+ * Mark all popup windows in the current tab and global for redrawing.
+ */
+ void
+popup_redraw_all(void)
+{
+ win_T *wp;
+
+ FOR_ALL_POPUPWINS(wp)
+ wp->w_redr_type = UPD_NOT_VALID;
+ FOR_ALL_POPUPWINS_IN_TAB(curtab, wp)
+ wp->w_redr_type = UPD_NOT_VALID;
+}
+
/*
* Set the color for a notification window.
*/
int parse_completepopup(win_T *wp);
void popup_set_wantpos_cursor(win_T *wp, int width, dict_T *d);
void popup_set_wantpos_rowcol(win_T *wp, int row, int col);
+void popup_redraw_all(void);
void f_popup_clear(typval_T *argvars, typval_T *rettv);
void f_popup_create(typval_T *argvars, typval_T *rettv);
void f_popup_atcursor(typval_T *argvars, typval_T *rettv);
void screenalloc(int doclear);
void free_screenlines(void);
void screenclear(void);
+void redraw_as_cleared(void);
void line_was_clobbered(int screen_lnum);
int can_clear(char_u *p);
void screen_start(void);
static int screen_attr = 0;
static void screen_char_2(unsigned off, int row, int col);
-static void screenclear2(void);
+static void screenclear2(int doclear);
static void lineclear(unsigned off, int width, int attr);
static void lineinvalid(unsigned off, int width);
static int win_do_lines(win_T *wp, int row, int line_count, int mayclear, int del, int clear_attr);
set_must_redraw(UPD_CLEAR); // need to clear the screen later
if (doclear)
- screenclear2();
+ screenclear2(TRUE);
#ifdef FEAT_GUI
else if (gui.in_use
&& !gui.starting
#endif
}
+/*
+ * Clear the screen.
+ * May delay if there is something the user should read.
+ * Allocated the screen for resizing if needed.
+ */
void
screenclear(void)
{
check_for_delay(FALSE);
screenalloc(FALSE); // allocate screen buffers if size changed
- screenclear2(); // clear the screen
+ screenclear2(TRUE); // clear the screen
+}
+
+/*
+ * Do not clear the screen but mark everything for redraw.
+ */
+ void
+redraw_as_cleared(void)
+{
+ screenclear2(FALSE);
}
static void
-screenclear2(void)
+screenclear2(int doclear)
{
int i;
LineWraps[i] = FALSE;
}
- if (can_clear(T_CL))
+ if (doclear && can_clear(T_CL))
{
out_str(T_CL); // clear the display
clear_cmdline = FALSE;
screen_cleared = TRUE; // can use contents of ScreenLines now
- win_rest_invalid(firstwin);
+ win_rest_invalid(firstwin); // redraw all regular windows
+#ifdef FEAT_PROP_POPUP
+ popup_redraw_all(); // redraw all popup windows
+#endif
redraw_cmdline = TRUE;
redraw_tabline = TRUE;
if (must_redraw == UPD_CLEAR) // no need to clear again