mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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.
This commit is contained in:
12
src/buffer.c
12
src/buffer.c
@@ -3746,19 +3746,17 @@ maketitle(void)
|
||||
if (stl_syntax & STL_IN_TITLE)
|
||||
{
|
||||
int use_sandbox = FALSE;
|
||||
int save_called_emsg = called_emsg;
|
||||
int called_emsg_before = called_emsg;
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
use_sandbox = was_set_insecurely((char_u *)"titlestring", 0);
|
||||
# endif
|
||||
called_emsg = FALSE;
|
||||
build_stl_str_hl(curwin, title_str, sizeof(buf),
|
||||
p_titlestring, use_sandbox,
|
||||
0, maxlen, NULL, NULL);
|
||||
if (called_emsg)
|
||||
if (called_emsg > called_emsg_before)
|
||||
set_string_option_direct((char_u *)"titlestring", -1,
|
||||
(char_u *)"", OPT_FREE, SID_ERROR);
|
||||
called_emsg |= save_called_emsg;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -3879,19 +3877,17 @@ maketitle(void)
|
||||
if (stl_syntax & STL_IN_ICON)
|
||||
{
|
||||
int use_sandbox = FALSE;
|
||||
int save_called_emsg = called_emsg;
|
||||
int called_emsg_before = called_emsg;
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
use_sandbox = was_set_insecurely((char_u *)"iconstring", 0);
|
||||
# endif
|
||||
called_emsg = FALSE;
|
||||
build_stl_str_hl(curwin, icon_str, sizeof(buf),
|
||||
p_iconstring, use_sandbox,
|
||||
0, 0, NULL, NULL);
|
||||
if (called_emsg)
|
||||
if (called_emsg > called_emsg_before)
|
||||
set_string_option_direct((char_u *)"iconstring", -1,
|
||||
(char_u *)"", OPT_FREE, SID_ERROR);
|
||||
called_emsg |= save_called_emsg;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user