Backport #72049 to 24.9: Another fix for client syntax highlighting

This commit is contained in:
robot-clickhouse 2024-11-19 08:08:03 +00:00
parent 622dc2d161
commit 6365afc1a8

View File

@ -53,7 +53,12 @@ void Expected::highlight(HighlightedRange range)
/// for each highlight x and the next one y: x.end <= y.begin, thus preventing any overlap.
if (it != highlights.begin())
it = std::prev(it);
{
auto prev_it = std::prev(it);
if (range.begin < prev_it->end)
it = prev_it;
}
while (it != highlights.end() && range.begin < it->end)
{