diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-11-20 02:27:16 +0100 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2023-11-21 09:38:32 +0000 |
commit | 585eeacb24e1aa0fed978e46063de100b16b8bdf (patch) | |
tree | 023df9778c072cef7fa36d4b23ed96d5a9dc2997 /src/nvim/decoration.c | |
parent | fec5e3ab247bcc1ced67f1d0aa7fa10f694f933b (diff) | |
download | rneovim-585eeacb24e1aa0fed978e46063de100b16b8bdf.tar.gz rneovim-585eeacb24e1aa0fed978e46063de100b16b8bdf.tar.bz2 rneovim-585eeacb24e1aa0fed978e46063de100b16b8bdf.zip |
refactor(sign): store 'signcolumn' width range when it is set
Problem: Minimum and maximum signcolumn width is determined each redraw.
Solution: Determine and store 'signcolumn' range when option is set.
Diffstat (limited to 'src/nvim/decoration.c')
-rw-r--r-- | src/nvim/decoration.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c index 48dffea24b..b784d8bea3 100644 --- a/src/nvim/decoration.c +++ b/src/nvim/decoration.c @@ -442,7 +442,9 @@ void decor_redraw_signs(win_T *wp, buf_T *buf, int row, SignTextAttrs sattrs[], int *cul_id, int *num_id) { MarkTreeIter itr[1]; - if (!buf->b_signs || !marktree_itr_get_overlap(buf->b_marktree, row, 0, itr)) { + if (!buf->b_signs + || wp->w_minscwidth == SCL_NO + || !marktree_itr_get_overlap(buf->b_marktree, row, 0, itr)) { return; } @@ -471,7 +473,7 @@ void decor_redraw_signs(win_T *wp, buf_T *buf, int row, SignTextAttrs sattrs[], } if (kv_size(signs)) { - int width = (*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u') ? 1 : wp->w_scwidth; + int width = wp->w_minscwidth == SCL_NUM ? 1 : wp->w_scwidth; int idx = MIN(width, num_text) - 1; qsort((void *)&kv_A(signs, 0), kv_size(signs), sizeof(MTKey), sign_cmp); |