mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
refactor(column): remove unused build_statuscol_str() arguments
Problem: `build_statuscol_str()` still has arguments that were necessary for building a status column string in `number_width()`, which was abandoned in #22094. Solution: Remove unused arguments.
This commit is contained in:
parent
7a710f5f08
commit
60ab22dfa6
@ -442,14 +442,12 @@ static void get_statuscol_str(win_T *wp, linenr_T lnum, int row, int startrow, i
|
||||
if (wp->w_statuscol_line_count != wp->w_nrwidth_line_count) {
|
||||
wp->w_statuscol_line_count = wp->w_nrwidth_line_count;
|
||||
set_vim_var_nr(VV_VIRTNUM, 0);
|
||||
build_statuscol_str(wp, wp->w_nrwidth_line_count, 0, stcp->width,
|
||||
' ', stcp->text, &stcp->hlrec, stcp);
|
||||
build_statuscol_str(wp, wp->w_nrwidth_line_count, 0, stcp);
|
||||
stcp->width += stcp->truncate;
|
||||
}
|
||||
set_vim_var_nr(VV_VIRTNUM, virtnum);
|
||||
|
||||
int width = build_statuscol_str(wp, lnum, relnum, stcp->width,
|
||||
' ', stcp->text, &stcp->hlrec, stcp);
|
||||
int width = build_statuscol_str(wp, lnum, relnum, stcp);
|
||||
// Force a redraw in case of error or when truncated
|
||||
if (*wp->w_p_stc == NUL || (stcp->truncate > 0 && wp->w_nrwidth < MAX_NUMBERWIDTH)) {
|
||||
if (stcp->truncate) { // Avoid truncating 'statuscolumn'
|
||||
|
@ -885,11 +885,8 @@ void draw_tabline(void)
|
||||
/// Build the 'statuscolumn' string for line "lnum". When "relnum" == -1,
|
||||
/// the v:lnum and v:relnum variables don't have to be updated.
|
||||
///
|
||||
/// @param hlrec HL attributes (can be NULL)
|
||||
/// @param stcp Status column attributes (can be NULL)
|
||||
/// @return The width of the built status column string for line "lnum"
|
||||
int build_statuscol_str(win_T *wp, linenr_T lnum, long relnum, int maxwidth, int fillchar,
|
||||
char *buf, stl_hlrec_t **hlrec, statuscol_T *stcp)
|
||||
int build_statuscol_str(win_T *wp, linenr_T lnum, long relnum, statuscol_T *stcp)
|
||||
{
|
||||
bool fillclick = relnum >= 0 && lnum == wp->w_topline;
|
||||
|
||||
@ -900,8 +897,8 @@ int build_statuscol_str(win_T *wp, linenr_T lnum, long relnum, int maxwidth, int
|
||||
|
||||
StlClickRecord *clickrec;
|
||||
char *stc = xstrdup(wp->w_p_stc);
|
||||
int width = build_stl_str_hl(wp, buf, MAXPATHL, stc, "statuscolumn", OPT_LOCAL, fillchar,
|
||||
maxwidth, hlrec, fillclick ? &clickrec : NULL, stcp);
|
||||
int width = build_stl_str_hl(wp, stcp->text, MAXPATHL, stc, "statuscolumn", OPT_LOCAL, ' ',
|
||||
stcp->width, &stcp->hlrec, fillclick ? &clickrec : NULL, stcp);
|
||||
xfree(stc);
|
||||
|
||||
// Only update click definitions once per window per redraw
|
||||
@ -909,7 +906,7 @@ int build_statuscol_str(win_T *wp, linenr_T lnum, long relnum, int maxwidth, int
|
||||
stl_clear_click_defs(wp->w_statuscol_click_defs, wp->w_statuscol_click_defs_size);
|
||||
wp->w_statuscol_click_defs = stl_alloc_click_defs(wp->w_statuscol_click_defs, width,
|
||||
&wp->w_statuscol_click_defs_size);
|
||||
stl_fill_click_defs(wp->w_statuscol_click_defs, clickrec, buf, width, false);
|
||||
stl_fill_click_defs(wp->w_statuscol_click_defs, clickrec, stcp->text, width, false);
|
||||
}
|
||||
|
||||
return width;
|
||||
|
Loading…
Reference in New Issue
Block a user