From c6218461601f5e8bf2a809033e65046a8acda7a5 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Mon, 8 Feb 2010 16:00:12 +0100 Subject: [PATCH] Avoid display corruption on :vsp and 'go' changes Always redraw the screen when splitting vertically or when the 'go' option is modified (it may e.g. cause scrollbars to hide/show). --- src/option.c | 8 +++++++- src/window.c | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/option.c b/src/option.c index a693c1cab4..6ab9a3b141 100644 --- a/src/option.c +++ b/src/option.c @@ -1277,7 +1277,13 @@ static struct vimoption (char_u *)NULL, PV_NONE, #endif {(char_u *)50L, (char_u *)0L} SCRIPTID_INIT}, - {"guioptions", "go", P_STRING|P_VI_DEF|P_RALL|P_FLAGLIST, + {"guioptions", "go", P_STRING|P_VI_DEF|P_RALL|P_FLAGLIST +# ifdef FEAT_GUI_MACVIM + /* Scrollbars etc. may change the view, if this happens without a + * redraw the display may get corrupted, so always redraw. */ + |P_RCLR +# endif + , #if defined(FEAT_GUI) (char_u *)&p_go, PV_NONE, # if defined(UNIX) && !defined(MACOS) diff --git a/src/window.c b/src/window.c index c1955ad700..a35c1f41e0 100644 --- a/src/window.c +++ b/src/window.c @@ -1097,7 +1097,12 @@ win_split_ins(size, flags, newwin, dir) */ redraw_win_later(wp, NOT_VALID); wp->w_redr_status = TRUE; +#ifdef FEAT_GUI_MACVIM + /* The view may have moved, so clear all or display may get corrupted. */ + redraw_win_later(oldwin, CLEAR); +#else redraw_win_later(oldwin, NOT_VALID); +#endif oldwin->w_redr_status = TRUE; if (need_status) @@ -5575,7 +5580,12 @@ win_new_width(wp, width) update_topline(); curs_columns(TRUE); /* validate w_wrow */ } +#ifdef FEAT_GUI_MACVIM + /* The view may have moved, so clear all or display may get corrupted. */ + redraw_win_later(wp, CLEAR); +#else redraw_win_later(wp, NOT_VALID); +#endif wp->w_redr_status = TRUE; } #endif