feat(extmarks): allow preventing spellchecking with spell = false

This commit is contained in:
Thomas Vigouroux
2022-09-13 09:44:24 +02:00
committed by Lewis Russell
parent 7335a67b57
commit 7e6d785d19
8 changed files with 71 additions and 24 deletions

View File

@@ -69,7 +69,11 @@ void bufhl_add_hl_pos_offset(buf_T *buf, int src_id, int hl_id, lpos_T pos_start
void decor_redraw(buf_T *buf, int row1, int row2, Decoration *decor)
{
if (row2 >= row1) {
if (!decor || decor->hl_id || decor_has_sign(decor) || decor->conceal || decor->spell) {
if (!decor
|| decor->hl_id
|| decor_has_sign(decor)
|| decor->conceal
|| decor->spell != kNone) {
redraw_buf_range_later(buf, row1 + 1, row2 + 1);
}
}
@@ -309,7 +313,7 @@ next_mark:
bool conceal = 0;
int conceal_char = 0;
int conceal_attr = 0;
bool spell = false;
TriState spell = kNone;
for (size_t i = 0; i < kv_size(state->active); i++) {
DecorRange item = kv_A(state->active, i);
@@ -343,8 +347,8 @@ next_mark:
conceal_attr = item.attr_id;
}
}
if (active && item.decor.spell) {
spell = true;
if (active && item.decor.spell != kNone) {
spell = item.decor.spell;
}
if ((item.start_row == state->row && item.start_col <= col)
&& decor_virt_pos(item.decor)