mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
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)
This commit is contained in:
committed by
Bram Moolenaar
parent
1756f4b218
commit
7b224fdf4a
@@ -3763,8 +3763,6 @@ get_tabline_label(
|
||||
opt = (tooltip ? &p_gtt : &p_gtl);
|
||||
if (**opt != NUL)
|
||||
{
|
||||
int use_sandbox = FALSE;
|
||||
int called_emsg_before = called_emsg;
|
||||
char_u res[MAXPATHL];
|
||||
tabpage_T *save_curtab;
|
||||
char_u *opt_name = (char_u *)(tooltip ? "guitabtooltip"
|
||||
@@ -3773,7 +3771,6 @@ get_tabline_label(
|
||||
printer_page_num = tabpage_index(tp);
|
||||
# ifdef FEAT_EVAL
|
||||
set_vim_var_nr(VV_LNUM, printer_page_num);
|
||||
use_sandbox = was_set_insecurely(opt_name, 0);
|
||||
# endif
|
||||
// It's almost as going to the tabpage, but without autocommands.
|
||||
curtab->tp_firstwin = firstwin;
|
||||
@@ -3788,7 +3785,7 @@ get_tabline_label(
|
||||
curbuf = curwin->w_buffer;
|
||||
|
||||
// Can't use NameBuff directly, build_stl_str_hl() uses it.
|
||||
build_stl_str_hl(curwin, res, MAXPATHL, *opt, use_sandbox,
|
||||
build_stl_str_hl(curwin, res, MAXPATHL, *opt, opt_name, 0,
|
||||
0, (int)Columns, NULL, NULL);
|
||||
STRCPY(NameBuff, res);
|
||||
|
||||
@@ -3799,10 +3796,6 @@ get_tabline_label(
|
||||
lastwin = curtab->tp_lastwin;
|
||||
curwin = curtab->tp_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
|
||||
if (called_emsg > called_emsg_before)
|
||||
set_string_option_direct(opt_name, -1,
|
||||
(char_u *)"", OPT_FREE, SID_ERROR);
|
||||
}
|
||||
|
||||
// If 'guitablabel'/'guitabtooltip' is not set or the result is empty then
|
||||
|
Reference in New Issue
Block a user