fix(column): estimate 'statuscolumn' width appropriately

Problem:    The 'statuscolumn' width is being estimated without the
            proper context. In particular, this resulted in the fact
            that a custom fold column could be included in the estimated
            `number_width()`, and doubly added when actually drawing the
            statuscolumn due to `win_col_off()` also adding the
            `'foldcolumn'` width. Resulting in a status column that is
            `'foldcolumn'` cells wider than necessary.
Solution:   Estimate 'statuscolumn' width in `get_statuscol_str()` when
            a buffer's line count has changed.
This commit is contained in:
luukvbaal
2023-02-02 10:35:51 +01:00
committed by GitHub
parent 2c5906b55b
commit 64fa75a86a
4 changed files with 36 additions and 10 deletions

View File

@@ -1392,6 +1392,7 @@ struct window_S {
int w_prev_fraction_row;
linenr_T w_nrwidth_line_count; // line count when ml_nrwidth_width was computed.
linenr_T w_statuscol_line_count; // line count when 'statuscolumn' width was computed.
int w_nrwidth_width; // nr of chars to print line count.
qf_info_T *w_llist; // Location list for this window