From 53989554a44caca0964376d60297f08ec257c53c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 23 Dec 2019 22:59:18 +0100 Subject: patch 8.2.0035: saving and restoring called_emsg is clumsy Problem: Saving and restoring called_emsg is clumsy. Solution: Count the number of error messages. --- src/gui.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/gui.c') diff --git a/src/gui.c b/src/gui.c index 8fd311474..7b5930058 100644 --- a/src/gui.c +++ b/src/gui.c @@ -3704,14 +3704,12 @@ get_tabline_label( if (**opt != NUL) { int use_sandbox = FALSE; - int save_called_emsg = called_emsg; + int called_emsg_before = called_emsg; char_u res[MAXPATHL]; tabpage_T *save_curtab; char_u *opt_name = (char_u *)(tooltip ? "guitabtooltip" : "guitablabel"); - called_emsg = FALSE; - printer_page_num = tabpage_index(tp); # ifdef FEAT_EVAL set_vim_var_nr(VV_LNUM, printer_page_num); @@ -3742,10 +3740,9 @@ get_tabline_label( curwin = curtab->tp_curwin; curbuf = curwin->w_buffer; - if (called_emsg) + if (called_emsg > called_emsg_before) set_string_option_direct(opt_name, -1, (char_u *)"", OPT_FREE, SID_ERROR); - called_emsg |= save_called_emsg; } // If 'guitablabel'/'guitabtooltip' is not set or the result is empty then -- cgit v1.2.1