From 7b224fdf4a29f115567d4fc8629c1cef92d8444a Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Mon, 7 Nov 2022 12:16:51 +0000 Subject: patch 9.0.0844: handling 'statusline' errors is spread out Problem: Handling 'statusline' errors is spread out. Solution: Pass the option name to the lower levels so the option can be reset there when an error is encountered. (Luuk van Baal, closes #11467) --- src/drawscreen.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/drawscreen.c') diff --git a/src/drawscreen.c b/src/drawscreen.c index 5a23d54fd6..361f98b24f 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -573,7 +573,6 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) redraw_custom_statusline(win_T *wp) { static int entered = FALSE; - int saved_did_emsg = did_emsg; // When called recursively return. This can happen when the statusline // contains an expression that triggers a redraw. @@ -581,18 +580,7 @@ redraw_custom_statusline(win_T *wp) return; entered = TRUE; - did_emsg = FALSE; win_redr_custom(wp, FALSE); - if (did_emsg) - { - // When there is an error disable the statusline, otherwise the - // display is messed up with errors and a redraw triggers the problem - // again and again. - set_string_option_direct((char_u *)"statusline", -1, - (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL - ? OPT_LOCAL : OPT_GLOBAL), SID_ERROR); - } - did_emsg |= saved_did_emsg; entered = FALSE; } #endif @@ -673,12 +661,7 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) #ifdef FEAT_STL_OPT if (*p_ruf) { - int called_emsg_before = called_emsg; - win_redr_custom(wp, TRUE); - if (called_emsg > called_emsg_before) - set_string_option_direct((char_u *)"rulerformat", -1, - (char_u *)"", OPT_FREE, SID_ERROR); return; } #endif -- cgit v1.2.3