1
0
forked from aniani/vim

patch 9.1.0124: display of below/right virtual text with non-virtual text overlap

Problem:  Virtual text with text_align 'right'/'below' wasn't being
          used when a non-virtual text property overlaps with the end of
          the line. This was because the non-virtual text property had a
          higher priority, preventing the virtual text from being used.
Solution: Fix the sorting of text properties so virtual text properties
          have a higher priority than non-virtual text properties.
          (Dylan Thacker-Smith)

related: #14063

Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Dylan Thacker-Smith
2024-02-21 21:00:59 +01:00
committed by Christian Brabandt
parent ec9c32637f
commit 8055721c2d
4 changed files with 55 additions and 4 deletions

View File

@@ -758,6 +758,11 @@ text_prop_compare(const void *s1, const void *s2)
tp2 = &text_prop_compare_props[idx2];
col1 = tp1->tp_col;
col2 = tp2->tp_col;
// property that inserts text has priority over one that doesn't
if ((tp1->tp_id < 0) != (tp2->tp_id < 0))
return tp1->tp_id < 0 ? 1 : -1;
if (col1 == MAXCOL || col2 == MAXCOL)
{
int order1 = text_prop_order(tp1->tp_flags);
@@ -768,10 +773,6 @@ text_prop_compare(const void *s1, const void *s2)
return order1 < order2 ? 1 : -1;
}
// property that inserts text has priority over one that doesn't
if ((tp1->tp_id < 0) != (tp2->tp_id < 0))
return tp1->tp_id < 0 ? 1 : -1;
// check highest priority, defined by the type
pt1 = text_prop_type_by_id(text_prop_compare_buf, tp1->tp_type);
pt2 = text_prop_type_by_id(text_prop_compare_buf, tp2->tp_type);