fix(decoration): don't show signcolumn for non-sign_text extmark (#22135)

Fixes: #22127
This commit is contained in:
Lewis Russell
2023-02-05 23:49:43 +00:00
committed by GitHub
parent 7963a160e9
commit 228684d2fb
4 changed files with 25 additions and 5 deletions

View File

@@ -100,9 +100,13 @@ void decor_remove(buf_T *buf, int row, int row2, Decoration *decor)
if (decor_has_sign(decor)) {
assert(buf->b_signs > 0);
buf->b_signs--;
}
if (row2 >= row && decor->sign_text) {
buf_signcols_del_check(buf, row + 1, row2 + 1);
if (decor->sign_text) {
assert(buf->b_signs_with_text > 0);
buf->b_signs_with_text--;
if (row2 >= row) {
buf_signcols_del_check(buf, row + 1, row2 + 1);
}
}
}
}
decor_free(decor);
@@ -445,11 +449,11 @@ int decor_signcols(buf_T *buf, DecorState *state, int row, int end_row, int max)
int signcols = 0; // highest value of count
int currow = -1; // current row
if (max <= 1 && buf->b_signs >= (size_t)max) {
if (max <= 1 && buf->b_signs_with_text >= (size_t)max) {
return max;
}
if (buf->b_signs == 0) {
if (buf->b_signs_with_text == 0) {
return 0;
}