0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 9.0.0993: display errors when adding or removing text property type

Problem:    Display errors when adding or removing text property type.
Solution:   Perform a full redraw.  Only use text properties for which the
            type is defined. (closes #11655)
This commit is contained in:
Bram Moolenaar
2022-12-02 20:46:26 +00:00
parent 500c444283
commit 89469d157a
11 changed files with 126 additions and 18 deletions

View File

@@ -986,11 +986,15 @@ init_chartabsize_arg(
mch_memmove(cts->cts_text_props + count, prop_start,
count * sizeof(textprop_T));
for (i = 0; i < count; ++i)
if (cts->cts_text_props[i + count].tp_id < 0)
{
textprop_T *tp = cts->cts_text_props + i + count;
if (tp->tp_id < 0
&& text_prop_type_valid(wp->w_buffer, tp))
{
cts->cts_has_prop_with_text = TRUE;
break;
}
}
if (!cts->cts_has_prop_with_text)
{
// won't use the text properties, free them