mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 14:48:15 +00:00
LibGUI: Support multiple layers of TextDocument spans
TextDocument::set_spans() now also takes a "span collection index" argument. TextDocument keeps a map between a span collection index and its spans. It merges the spans from all collections into a single set of spans whenever set_spans() is called. This allows us to style a document with multiple layers of spans, where as previously we only supported a single layer of spans that was set from the SyntaxHighlighter.
This commit is contained in:
@@ -1951,7 +1951,7 @@ void TextEditor::set_syntax_highlighter(OwnPtr<Syntax::Highlighter> highlighter)
|
||||
m_highlighter->attach(*this);
|
||||
m_needs_rehighlight = true;
|
||||
} else
|
||||
document().set_spans({});
|
||||
document().set_spans(Syntax::HighlighterClient::span_collection_index, {});
|
||||
if (on_highlighter_change)
|
||||
on_highlighter_change();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user