mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 22:08:18 +00:00
vim-patch:8.2.1909: number of status line items is limited to 80
Problem: Number of status line items is limited to 80.
Solution: Dynamically allocate the arrays. (Rom Grk, closes vim/vim#7181)
8133cc6bf4
The members of stl_item_T have not been prefixed with stl_ contrary to
the vim patch because the amount of stl_ prefixes on single lines of
code in that region was hurtful to readability.
This commit is contained in:
@@ -3751,11 +3751,10 @@ static char_u *set_chars_option(win_T *wp, char_u **varp, bool set)
|
||||
/// Return error message or NULL.
|
||||
char_u *check_stl_option(char_u *s)
|
||||
{
|
||||
int itemcnt = 0;
|
||||
int groupdepth = 0;
|
||||
static char_u errbuf[80];
|
||||
|
||||
while (*s && itemcnt < STL_MAX_ITEM) {
|
||||
while (*s) {
|
||||
// Check for valid keys after % sequences
|
||||
while (*s && *s != '%') {
|
||||
s++;
|
||||
@@ -3764,9 +3763,6 @@ char_u *check_stl_option(char_u *s)
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
if (*s != '%' && *s != ')') {
|
||||
itemcnt++;
|
||||
}
|
||||
if (*s == '%' || *s == STL_TRUNCMARK || *s == STL_SEPARATE) {
|
||||
s++;
|
||||
continue;
|
||||
@@ -3808,9 +3804,6 @@ char_u *check_stl_option(char_u *s)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (itemcnt >= STL_MAX_ITEM) {
|
||||
return (char_u *)N_("E541: too many items");
|
||||
}
|
||||
if (groupdepth != 0) {
|
||||
return (char_u *)N_("E542: unbalanced groups");
|
||||
}
|
||||
|
Reference in New Issue
Block a user