refactor: pass window to was_set_insecurely

working on get_foldtext and wanted to get rid of the curwin backup/restore.
Turns out it's not possible else f_foldtext is run on the same window.
Kept the cleanup anyway.
This commit is contained in:
Matthieu Coudron
2020-11-18 22:52:49 +01:00
parent 7dfeadb0fc
commit 4f1fc0f6d5
9 changed files with 33 additions and 32 deletions

View File

@@ -5205,7 +5205,7 @@ win_redr_custom (
fillchar = ' ';
attr = HL_ATTR(HLF_TPF);
maxwidth = Columns;
use_sandbox = was_set_insecurely((char_u *)"tabline", 0);
use_sandbox = was_set_insecurely(wp, (char_u *)"tabline", 0);
} else {
row = W_ENDROW(wp);
fillchar = fillchar_status(&attr, wp);
@@ -5236,14 +5236,14 @@ win_redr_custom (
attr = HL_ATTR(HLF_MSG);
}
use_sandbox = was_set_insecurely((char_u *)"rulerformat", 0);
use_sandbox = was_set_insecurely(wp, (char_u *)"rulerformat", 0);
} else {
if (*wp->w_p_stl != NUL)
stl = wp->w_p_stl;
else
stl = p_stl;
use_sandbox = was_set_insecurely((char_u *)"statusline",
*wp->w_p_stl == NUL ? 0 : OPT_LOCAL);
use_sandbox = was_set_insecurely(
wp, (char_u *)"statusline", *wp->w_p_stl == NUL ? 0 : OPT_LOCAL);
}
col += wp->w_wincol;