diff options
Diffstat (limited to 'src/nvim/statusline.c')
-rw-r--r-- | src/nvim/statusline.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c index 7ed840c2f9..0a716067c6 100644 --- a/src/nvim/statusline.c +++ b/src/nvim/statusline.c @@ -411,7 +411,7 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler) // might change the option value and free the memory. stl = xstrdup(stl); build_stl_str_hl(ewp, buf, sizeof(buf), stl, opt_idx, opt_scope, - fillchar, maxwidth, &hltab, &tabtab, NULL); + fillchar, maxwidth, &hltab, NULL, &tabtab, NULL); xfree(stl); ewp->w_p_crb = p_crb_save; @@ -880,7 +880,7 @@ int build_statuscol_str(win_T *wp, linenr_T lnum, linenr_T relnum, char *buf, st StlClickRecord *clickrec; char *stc = xstrdup(wp->w_p_stc); int width = build_stl_str_hl(wp, buf, MAXPATHL, stc, kOptStatuscolumn, OPT_LOCAL, 0, - stcp->width, &stcp->hlrec, fillclick ? &clickrec : NULL, stcp); + stcp->width, &stcp->hlrec, NULL, fillclick ? &clickrec : NULL, stcp); xfree(stc); if (fillclick) { @@ -922,7 +922,7 @@ int build_statuscol_str(win_T *wp, linenr_T lnum, linenr_T relnum, char *buf, st /// @return The final width of the statusline int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, OptIndex opt_idx, int opt_scope, schar_T fillchar, int maxwidth, stl_hlrec_t **hltab, - StlClickRecord **tabtab, statuscol_T *stcp) + size_t *hltab_len, StlClickRecord **tabtab, statuscol_T *stcp) { static size_t stl_items_len = 20; // Initial value, grows as needed. static stl_item_t *stl_items = NULL; @@ -2132,6 +2132,9 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, OptIndex op sp->start = NULL; sp->userhl = 0; } + if (hltab_len) { + *hltab_len = (size_t)itemcnt; + } // Store the info about tab pages labels. if (tabtab != NULL) { |