mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02: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:
Notes:
sideshowbarker
2024-07-17 20:33:50 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/ab0b4f46f7 Pull-request: https://github.com/SerenityOS/serenity/pull/13335 Reviewed-by: https://github.com/alimpfard ✅
@@ -33,6 +33,8 @@ public:
|
||||
String get_text() const { return highlighter_did_request_text(); }
|
||||
GUI::TextDocument& get_document() { return highlighter_did_request_document(); }
|
||||
GUI::TextPosition get_cursor() const { return highlighter_did_request_cursor(); }
|
||||
|
||||
static constexpr auto span_collection_index = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user