mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +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:
parent
b75ed992a6
commit
ab0b4f46f7
5 changed files with 107 additions and 2 deletions
|
@ -242,6 +242,8 @@ protected:
|
|||
int ruler_width() const;
|
||||
int gutter_width() const;
|
||||
|
||||
virtual void highlighter_did_set_spans(Vector<TextDocumentSpan> spans) final { document().set_spans(Syntax::HighlighterClient::span_collection_index, move(spans)); }
|
||||
|
||||
private:
|
||||
friend class TextDocumentLine;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue