Patch 8.2.1909
Problem: Number of status line items is limited to 80.
Solution: Dynamically allocate the arrays. (Rom Grk, closes #7181)
Files: runtime/doc/options.txt, src/buffer.c, src/optionstr.c,
src/proto/
buffer.pro, src/screen.c, src/structs.h,
src/testdir/test_options.vim, src/testdir/test_statusline.vim,
src/vim.h
*** ../vim-8.2.1908/runtime/doc/options.txt 2020-08-28 21:04:20.498881375 +0200
--- runtime/doc/options.txt 2020-10-26 20:32:51.154189065 +0100
***************
*** 7225,7231 ****
normal text. Each status line item is of the form:
%-0{minwid}.{maxwid}{item}
All fields except the {item} are optional. A single percent sign can
! be given as "%%". Up to 80 items can be specified. *E541*
When the option starts with "%!" then it is used as an expression,
evaluated and the result is used as the option value. Example: >
--- 7225,7231 ----
normal text. Each status line item is of the form:
%-0{minwid}.{maxwid}{item}
All fields except the {item} are optional. A single percent sign can
! be given as "%%".
When the option starts with "%!" then it is used as an expression,
evaluated and the result is used as the option value. Example: >
*** ../vim-8.2.1908/src/buffer.c 2020-10-25 17:55:06.173001826 +0100
--- src/buffer.c 2020-10-26 21:00:05.326116950 +0100
***************
*** 673,679 ****
buf->b_nwindows = nwindows;
buf_freeall(buf, (del_buf ? BFA_DEL : 0)
! + (wipe_buf ? BFA_WIPE : 0)
+ (ignore_abort ? BFA_IGNORE_ABORT : 0));
// Autocommands may have deleted the buffer.
--- 673,679 ----
buf->b_nwindows = nwindows;
buf_freeall(buf, (del_buf ? BFA_DEL : 0)
! + (wipe_buf ? BFA_WIPE : 0)
+ (ignore_abort ? BFA_IGNORE_ABORT : 0));
// Autocommands may have deleted the buffer.
***************
*** 4017,4022 ****
--- 4017,4048 ----
#endif // FEAT_TITLE
#if defined(FEAT_STL_OPT) || defined(FEAT_GUI_TABLINE) || defined(PROTO)
+
+ /*
+ * Used for building in the status line.
+ */
+ typedef struct
+ {
+ char_u *stl_start;
+ int stl_minwid;
+ int stl_maxwid;
+ enum {
+ Normal,
+ Empty,
+ Group,
+ Middle,
+ Highlight,
+ TabPage,
+ Trunc
+ } stl_type;
+ } stl_item_T;
+
+ static size_t stl_items_len = 20; // Initial value, grows as needed.
+ static stl_item_T *stl_items = NULL;
+ static int *stl_groupitem = NULL;
+ static stl_hlrec_T *stl_hltab = NULL;
+ static stl_hlrec_T *stl_tabtab = NULL;
+
/*
* Build a string from the status line items in "fmt".
* Return length of string in screen cells.
***************
*** 4040,4047 ****
int use_sandbox UNUSED, // "fmt" was set insecurely, use sandbox
int fillchar,
int maxwidth,
! struct stl_hlrec *hltab, // return: HL attributes (can be NULL)
! struct stl_hlrec *tabtab) // return: tab page nrs (can be NULL)
{
linenr_T lnum;
size_t len;
--- 4066,4073 ----
int use_sandbox UNUSED, // "fmt" was set insecurely, use sandbox
int fillchar,
int maxwidth,
! stl_hlrec_T **hltab, // return: HL attributes (can be NULL)
! stl_hlrec_T **tabtab) // return: tab page nrs (can be NULL)
{
linenr_T lnum;
size_t len;
***************
*** 4069,4092 ****
int curitem;
int group_end_userhl;
int group_start_userhl;
- int groupitem[STL_MAX_ITEM];
int groupdepth;
- struct stl_item
- {
- char_u *start;
- int minwid;
- int maxwid;
- enum
- {
- Normal,
- Empty,
- Group,
- Middle,
- Highlight,
- TabPage,
- Trunc
- } type;
- } item[STL_MAX_ITEM];
int minwid;
int maxwid;
int zeropad;
--- 4095,4101 ----
***************
*** 4096,4105 ****
char_u buf_tmp[TMPLEN];
char_u win_tmp[TMPLEN];
char_u *usefmt = fmt;
! struct stl_hlrec *sp;
int save_must_redraw = must_redraw;
int save_redr_type = curwin->w_redr_type;
#ifdef FEAT_EVAL
/*
* When the format starts with "%!" then evaluate it as an expression and
--- 4105,4122 ----
char_u buf_tmp[TMPLEN];
char_u win_tmp[TMPLEN];
char_u *usefmt = fmt;
! stl_hlrec_T *sp;
int save_must_redraw = must_redraw;
int save_redr_type = curwin->w_redr_type;
+ if (stl_items == NULL)
+ {
+ stl_items = ALLOC_MULT(stl_item_T, stl_items_len);
+ stl_groupitem = ALLOC_MULT(int, stl_items_len);
+ stl_hltab = ALLOC_MULT(stl_hlrec_T, stl_items_len);
+ stl_tabtab = ALLOC_MULT(stl_hlrec_T, stl_items_len);
+ }
+
#ifdef FEAT_EVAL
/*
* When the format starts with "%!" then evaluate it as an expression and
***************
*** 4162,4177 ****
prevchar_isitem = FALSE;
for (s = usefmt; *s; )
{
! if (curitem == STL_MAX_ITEM)
{
! // There are too many items. Add the error code to the statusline
! // to give the user a hint about what went wrong.
! if (p + 6 < out + outlen)
! {
! mch_memmove(p, " E541", (size_t)5);
! p += 5;
! }
! break;
}
if (*s != NUL && *s != '%')
--- 4179,4208 ----
prevchar_isitem = FALSE;
for (s = usefmt; *s; )
{
! if (curitem == (int)stl_items_len)
{
! size_t new_len = stl_items_len * 3 / 2;
! stl_item_T *new_items;
! int *new_groupitem;
! stl_hlrec_T *new_hlrec;
!
! new_items = vim_realloc(stl_items, sizeof(stl_item_T) * new_len);
! if (new_items == NULL)
! break;
! stl_items = new_items;
! new_groupitem = vim_realloc(stl_groupitem, sizeof(int) * new_len);
! if (new_groupitem == NULL)
! break;
! stl_groupitem = new_groupitem;
! new_hlrec = vim_realloc(stl_hltab, sizeof(stl_hlrec_T) * new_len);
! if (new_hlrec == NULL)
! break;
! stl_hltab = new_hlrec;
! new_hlrec = vim_realloc(stl_tabtab, sizeof(stl_hlrec_T) * new_len);
! if (new_hlrec == NULL)
! break;
! stl_tabtab = new_hlrec;
! stl_items_len = new_len;
}
if (*s != NUL && *s != '%')
***************
*** 4204,4218 ****
s++;
if (groupdepth > 0)
continue;
! item[curitem].type = Middle;
! item[curitem++].start = p;
continue;
}
if (*s == STL_TRUNCMARK)
{
s++;
! item[curitem].type = Trunc;
! item[curitem++].start = p;
continue;
}
if (*s == ')')
--- 4235,4249 ----
s++;
if (groupdepth > 0)
continue;
! stl_items[curitem].stl_type = Middle;
! stl_items[curitem++].stl_start = p;
continue;
}
if (*s == STL_TRUNCMARK)
{
s++;
! stl_items[curitem].stl_type = Trunc;
! stl_items[curitem++].stl_start = p;
continue;
}
if (*s == ')')
***************
*** 4222,4304 ****
continue;
groupdepth--;
! t = item[groupitem[groupdepth]].start;
*p = NUL;
l = vim_strsize(t);
! if (curitem > groupitem[groupdepth] + 1
! && item[groupitem[groupdepth]].minwid == 0)
{
// remove group if all items are empty and highlight group
// doesn't change
group_start_userhl = group_end_userhl = 0;
! for (n = groupitem[groupdepth] - 1; n >= 0; n--)
{
! if (item[n].type == Highlight)
{
! group_start_userhl = group_end_userhl = item[n].minwid;
break;
}
}
! for (n = groupitem[groupdepth] + 1; n < curitem; n++)
{
! if (item[n].type == Normal)
break;
! if (item[n].type == Highlight)
! group_end_userhl = item[n].minwid;
}
if (n == curitem && group_start_userhl == group_end_userhl)
{
// empty group
p = t;
l = 0;
! for (n = groupitem[groupdepth] + 1; n < curitem; n++)
{
// do not use the highlighting from the removed group
! if (item[n].type == Highlight)
! item[n].type = Empty;
// adjust the start position of TabPage to the next
// item position
! if (item[n].type == TabPage)
! item[n].start = p;
}
}
}
! if (l > item[groupitem[groupdepth]].maxwid)
{
// truncate, remove n bytes of text at the start
if (has_mbyte)
{
// Find the first character that should be included.
n = 0;
! while (l >= item[groupitem[groupdepth]].maxwid)
{
l -= ptr2cells(t + n);
n += (*mb_ptr2len)(t + n);
}
}
else
! n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1;
*t = '<';
mch_memmove(t + 1, t + n, (size_t)(p - (t + n)));
p = p - n + 1;
// Fill up space left over by half a double-wide char.
! while (++l < item[groupitem[groupdepth]].minwid)
*p++ = fillchar;
// correct the start of the items for the truncation
! for (l = groupitem[groupdepth] + 1; l < curitem; l++)
{
! item[l].start -= n;
! if (item[l].start < t)
! item[l].start = t;
}
}
! else if (abs(item[groupitem[groupdepth]].minwid) > l)
{
// fill
! n = item[groupitem[groupdepth]].minwid;
if (n < 0)
{
// fill by appending characters
--- 4253,4337 ----
continue;
groupdepth--;
! t = stl_items[stl_groupitem[groupdepth]].stl_start;
*p = NUL;
l = vim_strsize(t);
! if (curitem > stl_groupitem[groupdepth] + 1
! && stl_items[stl_groupitem[groupdepth]].stl_minwid == 0)
{
// remove group if all items are empty and highlight group
// doesn't change
group_start_userhl = group_end_userhl = 0;
! for (n = stl_groupitem[groupdepth] - 1; n >= 0; n--)
{
! if (stl_items[n].stl_type == Highlight)
{
! group_start_userhl = group_end_userhl =
! stl_items[n].stl_minwid;
break;
}
}
! for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
{
! if (stl_items[n].stl_type == Normal)
break;
! if (stl_items[n].stl_type == Highlight)
! group_end_userhl = stl_items[n].stl_minwid;
}
if (n == curitem && group_start_userhl == group_end_userhl)
{
// empty group
p = t;
l = 0;
! for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
{
// do not use the highlighting from the removed group
! if (stl_items[n].stl_type == Highlight)
! stl_items[n].stl_type = Empty;
// adjust the start position of TabPage to the next
// item position
! if (stl_items[n].stl_type == TabPage)
! stl_items[n].stl_start = p;
}
}
}
! if (l > stl_items[stl_groupitem[groupdepth]].stl_maxwid)
{
// truncate, remove n bytes of text at the start
if (has_mbyte)
{
// Find the first character that should be included.
n = 0;
! while (l >= stl_items[stl_groupitem[groupdepth]].stl_maxwid)
{
l -= ptr2cells(t + n);
n += (*mb_ptr2len)(t + n);
}
}
else
! n = (long)(p - t) - stl_items[stl_groupitem[groupdepth]]
! .stl_maxwid + 1;
*t = '<';
mch_memmove(t + 1, t + n, (size_t)(p - (t + n)));
p = p - n + 1;
// Fill up space left over by half a double-wide char.
! while (++l < stl_items[stl_groupitem[groupdepth]].stl_minwid)
*p++ = fillchar;
// correct the start of the items for the truncation
! for (l = stl_groupitem[groupdepth] + 1; l < curitem; l++)
{
! stl_items[l].stl_start -= n;
! if (stl_items[l].stl_start < t)
! stl_items[l].stl_start = t;
}
}
! else if (abs(stl_items[stl_groupitem[groupdepth]].stl_minwid) > l)
{
// fill
! n = stl_items[stl_groupitem[groupdepth]].stl_minwid;
if (n < 0)
{
// fill by appending characters
***************
*** 4314,4321 ****
if (p + l >= out + outlen)
l = (long)((out + outlen) - p - 1);
p += l;
! for (n = groupitem[groupdepth] + 1; n < curitem; n++)
! item[n].start += l;
for ( ; l > 0; l--)
*t++ = fillchar;
}
--- 4347,4354 ----
if (p + l >= out + outlen)
l = (long)((out + outlen) - p - 1);
p += l;
! for (n = stl_groupitem[groupdepth] + 1; n < curitem; n++)
! stl_items[n].stl_start += l;
for ( ; l > 0; l--)
*t++ = fillchar;
}
***************
*** 4344,4352 ****
}
if (*s == STL_USER_HL)
{
! item[curitem].type = Highlight;
! item[curitem].start = p;
! item[curitem].minwid = minwid > 9 ? 1 : minwid;
s++;
curitem++;
continue;
--- 4377,4385 ----
}
if (*s == STL_USER_HL)
{
! stl_items[curitem].stl_type = Highlight;
! stl_items[curitem].stl_start = p;
! stl_items[curitem].stl_minwid = minwid > 9 ? 1 : minwid;
s++;
curitem++;
continue;
***************
*** 4360,4368 ****
// %X ends the close label, go back to the previously
// define tab label nr.
for (n = curitem - 1; n >= 0; --n)
! if (item[n].type == TabPage && item[n].minwid >= 0)
{
! minwid = item[n].minwid;
break;
}
}
--- 4393,4402 ----
// %X ends the close label, go back to the previously
// define tab label nr.
for (n = curitem - 1; n >= 0; --n)
! if (stl_items[n].stl_type == TabPage
! && stl_items[n].stl_minwid >= 0)
{
! minwid = stl_items[n].stl_minwid;
break;
}
}
***************
*** 4370,4378 ****
// close nrs are stored as negative values
minwid = - minwid;
}
! item[curitem].type = TabPage;
! item[curitem].start = p;
! item[curitem].minwid = minwid;
s++;
curitem++;
continue;
--- 4404,4412 ----
// close nrs are stored as negative values
minwid = - minwid;
}
! stl_items[curitem].stl_type = TabPage;
! stl_items[curitem].stl_start = p;
! stl_items[curitem].stl_minwid = minwid;
s++;
curitem++;
continue;
***************
*** 4390,4400 ****
minwid = (minwid > 50 ? 50 : minwid) * l;
if (*s == '(')
{
! groupitem[groupdepth++] = curitem;
! item[curitem].type = Group;
! item[curitem].start = p;
! item[curitem].minwid = minwid;
! item[curitem].maxwid = maxwid;
s++;
curitem++;
continue;
--- 4424,4434 ----
minwid = (minwid > 50 ? 50 : minwid) * l;
if (*s == '(')
{
! stl_groupitem[groupdepth++] = curitem;
! stl_items[curitem].stl_type = Group;
! stl_items[curitem].stl_start = p;
! stl_items[curitem].stl_minwid = minwid;
! stl_items[curitem].stl_maxwid = maxwid;
s++;
curitem++;
continue;
***************
*** 4647,4655 ****
++s;
if (*s == '#')
{
! item[curitem].type = Highlight;
! item[curitem].start = p;
! item[curitem].minwid = -syn_namen2id(t, (int)(s - t));
curitem++;
}
if (*s != NUL)
--- 4681,4689 ----
++s;
if (*s == '#')
{
! stl_items[curitem].stl_type = Highlight;
! stl_items[curitem].stl_start = p;
! stl_items[curitem].stl_minwid = -syn_namen2id(t, (int)(s - t));
curitem++;
}
if (*s != NUL)
***************
*** 4657,4664 ****
continue;
}
! item[curitem].start = p;
! item[curitem].type = Normal;
if (str != NULL && *str)
{
t = str;
--- 4691,4698 ----
continue;
}
! stl_items[curitem].stl_start = p;
! stl_items[curitem].stl_type = Normal;
if (str != NULL && *str)
{
t = str;
***************
*** 4757,4763 ****
p += STRLEN(p);
}
else
! item[curitem].type = Empty;
if (opt == STL_VIM_EXPR)
vim_free(str);
--- 4791,4797 ----
p += STRLEN(p);
}
else
! stl_items[curitem].stl_type = Empty;
if (opt == STL_VIM_EXPR)
vim_free(str);
***************
*** 4784,4799 ****
else
{
for ( ; l < itemcnt; l++)
! if (item[l].type == Trunc)
{
// Truncate at %< item.
! s = item[l].start;
break;
}
if (l == itemcnt)
{
// No %< item, truncate first item.
! s = item[0].start;
l = 0;
}
}
--- 4818,4833 ----
else
{
for ( ; l < itemcnt; l++)
! if (stl_items[l].stl_type == Trunc)
{
// Truncate at %< item.
! s = stl_items[l].stl_start;
break;
}
if (l == itemcnt)
{
// No %< item, truncate first item.
! s = stl_items[0].stl_start;
l = 0;
}
}
***************
*** 4819,4825 ****
else
s = out + maxwidth - 1;
for (l = 0; l < itemcnt; l++)
! if (item[l].start > s)
break;
itemcnt = l;
*s++ = '>';
--- 4853,4859 ----
else
s = out + maxwidth - 1;
for (l = 0; l < itemcnt; l++)
! if (stl_items[l].stl_start > s)
break;
itemcnt = l;
*s++ = '>';
***************
*** 4853,4862 ****
--n; // count the '<'
for (; l < itemcnt; l++)
{
! if (item[l].start - n >= s)
! item[l].start -= n;
else
! item[l].start = s;
}
}
width = maxwidth;
--- 4887,4896 ----
--n; // count the '<'
for (; l < itemcnt; l++)
{
! if (stl_items[l].stl_start - n >= s)
! stl_items[l].stl_start -= n;
else
! stl_items[l].stl_start = s;
}
}
width = maxwidth;
***************
*** 4865,4880 ****
{
// Apply STL_MIDDLE if any
for (l = 0; l < itemcnt; l++)
! if (item[l].type == Middle)
break;
if (l < itemcnt)
{
! p = item[l].start + maxwidth - width;
! STRMOVE(p, item[l].start);
! for (s = item[l].start; s < p; s++)
*s = fillchar;
for (l++; l < itemcnt; l++)
! item[l].start += maxwidth - width;
width = maxwidth;
}
}
--- 4899,4914 ----
{
// Apply STL_MIDDLE if any
for (l = 0; l < itemcnt; l++)
! if (stl_items[l].stl_type == Middle)
break;
if (l < itemcnt)
{
! p = stl_items[l].stl_start + maxwidth - width;
! STRMOVE(p, stl_items[l].stl_start);
! for (s = stl_items[l].stl_start; s < p; s++)
*s = fillchar;
for (l++; l < itemcnt; l++)
! stl_items[l].stl_start += maxwidth - width;
width = maxwidth;
}
}
***************
*** 4882,4894 ****
// Store the info about highlighting.
if (hltab != NULL)
{
! sp = hltab;
for (l = 0; l < itemcnt; l++)
{
! if (item[l].type == Highlight)
{
! sp->start = item[l].start;
! sp->userhl = item[l].minwid;
sp++;
}
}
--- 4916,4929 ----
// Store the info about highlighting.
if (hltab != NULL)
{
! *hltab = stl_hltab;
! sp = stl_hltab;
for (l = 0; l < itemcnt; l++)
{
! if (stl_items[l].stl_type == Highlight)
{
! sp->start = stl_items[l].stl_start;
! sp->userhl = stl_items[l].stl_minwid;
sp++;
}
}
***************
*** 4899,4911 ****
// Store the info about tab pages labels.
if (tabtab != NULL)
{
! sp = tabtab;
for (l = 0; l < itemcnt; l++)
{
! if (item[l].type == TabPage)
{
! sp->start = item[l].start;
! sp->userhl = item[l].minwid;
sp++;
}
}
--- 4934,4947 ----
// Store the info about tab pages labels.
if (tabtab != NULL)
{
! *tabtab = stl_tabtab;
! sp = stl_tabtab;
for (l = 0; l < itemcnt; l++)
{
! if (stl_items[l].stl_type == TabPage)
{
! sp->start = stl_items[l].stl_start;
! sp->userhl = stl_items[l].stl_minwid;
sp++;
}
}
***************
*** 5534,5541 ****
bt_dontwrite(buf_T *buf)
{
return buf != NULL && (buf->b_p_bt[0] == 'n'
! || buf->b_p_bt[0] == 't'
! || buf->b_p_bt[0] == 'p');
}
#if defined(FEAT_QUICKFIX) || defined(PROTO)
--- 5570,5577 ----
bt_dontwrite(buf_T *buf)
{
return buf != NULL && (buf->b_p_bt[0] == 'n'
! || buf->b_p_bt[0] == 't'
! || buf->b_p_bt[0] == 'p');
}
#if defined(FEAT_QUICKFIX) || defined(PROTO)
*** ../vim-8.2.1908/src/optionstr.c 2020-09-05 14:27:19.466565808 +0200
--- src/optionstr.c 2020-10-26 20:32:51.158189056 +0100
***************
*** 571,581 ****
static char *
check_stl_option(char_u *s)
{
- int itemcnt = 0;
int groupdepth = 0;
static char errbuf[80];
! while (*s && itemcnt < STL_MAX_ITEM)
{
// Check for valid keys after % sequences
while (*s && *s != '%')
--- 571,580 ----
static char *
check_stl_option(char_u *s)
{
int groupdepth = 0;
static char errbuf[80];
! while (*s)
{
// Check for valid keys after % sequences
while (*s && *s != '%')
***************
*** 583,590 ****
if (!*s)
break;
s++;
- if (*s != '%' && *s != ')')
- ++itemcnt;
if (*s == '%' || *s == STL_TRUNCMARK || *s == STL_MIDDLEMARK)
{
s++;
--- 582,587 ----
***************
*** 627,634 ****
return N_("E540: Unclosed expression sequence");
}
}
- if (itemcnt >= STL_MAX_ITEM)
- return N_("E541: too many items");
if (groupdepth != 0)
return N_("E542: unbalanced groups");
return NULL;
--- 624,629 ----
*** ../vim-8.2.1908/src/proto/
buffer.pro 2020-10-25 17:55:06.173001826 +0100
--- src/proto/
buffer.pro 2020-10-26 20:48:56.299773867 +0100
***************
*** 48,54 ****
void maketitle(void);
void resettitle(void);
void free_titles(void);
! int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab);
void get_rel_pos(win_T *wp, char_u *buf, int buflen);
char_u *fix_fname(char_u *fname);
void fname_expand(buf_T *buf, char_u **ffname, char_u **sfname);
--- 48,54 ----
void maketitle(void);
void resettitle(void);
void free_titles(void);
! int build_stl_str_hl(win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, stl_hlrec_T **hltab, stl_hlrec_T **tabtab);
void get_rel_pos(win_T *wp, char_u *buf, int buflen);
char_u *fix_fname(char_u *fname);
void fname_expand(buf_T *buf, char_u **ffname, char_u **sfname);
*** ../vim-8.2.1908/src/screen.c 2020-08-23 15:09:31.808967049 +0200
--- src/screen.c 2020-10-26 20:39:41.393207929 +0100
***************
*** 1196,1203 ****
char_u buf[MAXPATHL];
char_u *stl;
char_u *p;
! struct stl_hlrec hltab[STL_MAX_ITEM];
! struct stl_hlrec tabtab[STL_MAX_ITEM];
int use_sandbox = FALSE;
win_T *ewp;
int p_crb_save;
--- 1196,1203 ----
char_u buf[MAXPATHL];
char_u *stl;
char_u *p;
! stl_hlrec_T *hltab;
! stl_hlrec_T *tabtab;
int use_sandbox = FALSE;
win_T *ewp;
int p_crb_save;
***************
*** 1287,1293 ****
stl = vim_strsave(stl);
width = build_stl_str_hl(ewp, buf, sizeof(buf),
stl, use_sandbox,
! fillchar, maxwidth, hltab, tabtab);
vim_free(stl);
ewp->w_p_crb = p_crb_save;
--- 1287,1293 ----
stl = vim_strsave(stl);
width = build_stl_str_hl(ewp, buf, sizeof(buf),
stl, use_sandbox,
! fillchar, maxwidth, &hltab, &tabtab);
vim_free(stl);
ewp->w_p_crb = p_crb_save;
*** ../vim-8.2.1908/src/structs.h 2020-10-24 20:49:37.490683063 +0200
--- src/structs.h 2020-10-26 20:43:28.180631222 +0100
***************
*** 1229,1242 ****
#endif
};
/*
* Used for highlighting in the status line.
*/
! struct stl_hlrec
{
char_u *start;
int userhl; // 0: no HL, 1-9: User HL, < 0 for syn ID
! };
/*
--- 1229,1243 ----
#endif
};
+
/*
* Used for highlighting in the status line.
*/
! typedef struct
{
char_u *start;
int userhl; // 0: no HL, 1-9: User HL, < 0 for syn ID
! } stl_hlrec_T;
/*
*** ../vim-8.2.1908/src/testdir/test_options.vim 2020-09-23 22:38:01.503927513 +0200
--- src/testdir/test_options.vim 2020-10-26 20:32:51.174189021 +0100
***************
*** 372,378 ****
call assert_fails('set commentstring=x', 'E537:')
call assert_fails('set complete=x', 'E539:')
call assert_fails('set statusline=%{', 'E540:')
- call assert_fails('set statusline=' . repeat("%p", 81), 'E541:')
call assert_fails('set statusline=%(', 'E542:')
if has('cursorshape')
" This invalid value for 'guicursor' used to cause Vim to crash.
--- 372,377 ----
*** ../vim-8.2.1908/src/testdir/test_statusline.vim 2020-10-01 19:06:31.847610500 +0200
--- src/testdir/test_statusline.vim 2020-10-26 20:32:51.174189021 +0100
***************
*** 376,381 ****
--- 376,396 ----
delfunc GetNested
delfunc GetStatusLine
+ " Test statusline works with 80+ items
+ function! StatusLabel()
+ redrawstatus
+ return '[label]'
+ endfunc
+ let statusline = '%{StatusLabel()}'
+ for i in range(150)
+ let statusline .= '%#TabLine' . (i % 2 == 0 ? 'Fill' : 'Sel') . '#' . string(i)[0]
+ endfor
+ let &statusline = statusline
+ redrawstatus
+ set statusline&
+ delfunc StatusLabel
+
+
" Check statusline in current and non-current window
" with the 'fillchars' option.
set fillchars=stl:^,stlnc:=,vert:\|,fold:-,diff:-
*** ../vim-8.2.1908/src/vim.h 2020-10-25 17:09:46.217011625 +0100
--- src/vim.h 2020-10-26 20:32:51.174189021 +0100
***************
*** 1699,1705 ****
#endif
#define SHOWCMD_COLS 10 // columns needed by shown command
- #define STL_MAX_ITEM 80 // max nr of %<flag> in statusline
typedef void *vim_acl_T; // dummy to pass an ACL to a function
--- 1699,1704 ----
*** ../vim-8.2.1908/src/version.c 2020-10-26 20:18:04.980177381 +0100
--- src/version.c 2020-10-26 20:47:31.627996999 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1909,
/**/
--
hundred-and-one symptoms of being an internet addict:
132. You come back and check this list every half-hour.
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language --
http://www.Zimbu.org ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///