vim-patch:8.2.2854: custom statusline cannot contain % items (#14558)

Problem:    Custom statusline cannot contain % items.
Solution:   Add "%{% expr %}". (closes vim/vim#8190)
30e3de21fc
This commit is contained in:
Shadman
2021-05-15 23:10:41 +06:00
committed by GitHub
parent 0cd1430316
commit d67dcaba02
4 changed files with 94 additions and 3 deletions

View File

@@ -3641,9 +3641,11 @@ char_u *check_stl_option(char_u *s)
return illegal_char(errbuf, sizeof(errbuf), *s);
}
if (*s == '{') {
int reevaluate = (*s == '%');
s++;
while (*s != '}' && *s)
while ((*s != '}' || (reevaluate && s[-1] != '%')) && *s) {
s++;
}
if (*s != '}') {
return (char_u *)N_("E540: Unclosed expression sequence");
}