summaryrefslogtreecommitdiff
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-12-23 22:59:18 +0100
committerBram Moolenaar <Bram@vim.org>2019-12-23 22:59:18 +0100
commit53989554a44caca0964376d60297f08ec257c53c (patch)
tree34d2140d4201e015661344b05ffb4c2d9aed97ff /src/gui.c
parent70188f5b23ea7efec7adaf74e0af797d1bb1afe8 (diff)
downloadvim-git-53989554a44caca0964376d60297f08ec257c53c.tar.gz
patch 8.2.0035: saving and restoring called_emsg is clumsyv8.2.0035
Problem: Saving and restoring called_emsg is clumsy. Solution: Count the number of error messages.
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c7
1 files changed, 2 insertions, 5 deletions
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