diff options
author | luukvbaal <31730729+luukvbaal@users.noreply.github.com> | 2023-01-09 18:12:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 17:12:06 +0000 |
commit | 364b131f42509326c912c9b0fef5dfc94ed23b41 (patch) | |
tree | 654f24fde95819257002aa9b36990efd6a80535c /src/nvim/drawscreen.c | |
parent | 50f03773f4b9f4638489ccfd0503dc9e39e5de78 (diff) | |
download | rneovim-364b131f42509326c912c9b0fef5dfc94ed23b41.tar.gz rneovim-364b131f42509326c912c9b0fef5dfc94ed23b41.tar.bz2 rneovim-364b131f42509326c912c9b0fef5dfc94ed23b41.zip |
feat(ui): add 'statuscolumn' option
Problem: Unable to customize the column next to a window ('gutter').
Solution: Add 'statuscolumn' option that follows the 'statusline' syntax,
allowing to customize the status column. Also supporting the %@
click execute function label. Adds new items @C and @s which
will print the fold and sign columns. Line numbers and signs
can be clicked, highlighted, aligned, transformed, margined etc.
Diffstat (limited to 'src/nvim/drawscreen.c')
-rw-r--r-- | src/nvim/drawscreen.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index de6bdda71e..568dbe99c0 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -522,7 +522,7 @@ int update_screen(void) // TODO(bfredl): special casing curwin here is SÅ JÄVLA BULL. // Either this should be done for all windows or not at all. if (curwin->w_redr_type < UPD_NOT_VALID - && curwin->w_nrwidth != ((curwin->w_p_nu || curwin->w_p_rnu) + && curwin->w_nrwidth != ((curwin->w_p_nu || curwin->w_p_rnu || *curwin->w_p_stc) ? number_width(curwin) : 0)) { curwin->w_redr_type = UPD_NOT_VALID; } @@ -1032,7 +1032,7 @@ static void win_update(win_T *wp, DecorProviders *providers) // Force redraw when width of 'number' or 'relativenumber' column // changes. - int nrwidth = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0; + int nrwidth = (wp->w_p_nu || wp->w_p_rnu || *wp->w_p_stc) ? number_width(wp) : 0; if (wp->w_nrwidth != nrwidth) { type = UPD_NOT_VALID; wp->w_nrwidth = nrwidth; @@ -1823,6 +1823,18 @@ static void win_update(win_T *wp, DecorProviders *providers) did_update = DID_NONE; } + // 'statuscolumn' width has changed or errored, start from the top. + if (wp->w_redr_statuscol) { + wp->w_redr_statuscol = false; + idx = 0; + row = 0; + lnum = wp->w_topline; + wp->w_lines_valid = 0; + wp->w_valid &= ~VALID_WCOL; + decor_providers_invoke_win(wp, providers, &line_providers, &provider_err); + continue; + } + if (lnum > buf->b_ml.ml_line_count) { eof = true; break; |