mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
feat(column)!: rework 'statuscolumn' %r/l items
Problem: A custom 'statuscolumn' needs to check a bunch of options and placed signs to replicate the default number column. Solution: Rework %l item to include the necessary logic to mimic the default number column. Remove now redundant %r item.
This commit is contained in:
@@ -587,12 +587,13 @@ static void draw_statuscol(win_T *wp, winlinevars_T *wlv, linenr_T lnum, int vir
|
||||
|
||||
char buf[MAXPATHL];
|
||||
// When a buffer's line count has changed, make a best estimate for the full
|
||||
// width of the status column by building with "w_nrwidth_line_count". Add
|
||||
// potentially truncated width and rebuild before drawing anything.
|
||||
// width of the status column by building with the largest possible line number.
|
||||
// Add potentially truncated width and rebuild before drawing anything.
|
||||
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);
|
||||
int width = build_statuscol_str(wp, wp->w_nrwidth_line_count, 0, buf, stcp);
|
||||
int width = build_statuscol_str(wp, wp->w_nrwidth_line_count,
|
||||
wp->w_nrwidth_line_count, buf, stcp);
|
||||
if (width > stcp->width) {
|
||||
int addwidth = MIN(width - stcp->width, MAX_STCWIDTH - stcp->width);
|
||||
wp->w_nrwidth += addwidth;
|
||||
|
Reference in New Issue
Block a user