mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 15:21:47 +00:00
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.
This commit is contained in:

committed by
Lewis Russell

parent
fec5e3ab24
commit
585eeacb24
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user