I would like to use a DecorationSet
to highlight ranges and certain words inside ranges.
For example, this part of the sentence is italics and four nouns are bold, within the italics range. I’d like to display italics text as green and bold text as red.
I have the start and end positions of each range and would like to combine these five ranges to one DecorationSet
to achieve the desired outcome. However, the longest range (green – italics) takes precedence over the shorter sub-ranges (red-bold) and hides their color. Is there a way to reverse this precedence so that both the long range and the shorter sub-ranges become visible?