mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibSyntax+LibGUI: Let syntax highlighters assign folding regions
This commit is contained in:
parent
92b128e20a
commit
d169af117d
Notes:
sideshowbarker
2024-07-17 01:00:06 +09:00
Author: https://github.com/AtkinsSJ
Commit: d169af117d
Pull-request: https://github.com/SerenityOS/serenity/pull/17581
Reviewed-by: https://github.com/alimpfard
4 changed files with 19 additions and 0 deletions
|
@ -281,6 +281,7 @@ protected:
|
|||
int fixed_elements_width() const { return gutter_width() + ruler_width() + folding_indicator_width(); }
|
||||
|
||||
virtual void highlighter_did_set_spans(Vector<TextDocumentSpan> spans) final { document().set_spans(Syntax::HighlighterClient::span_collection_index, move(spans)); }
|
||||
virtual void highlighter_did_set_folding_regions(Vector<TextDocumentFoldingRegion> folding_regions) final;
|
||||
|
||||
private:
|
||||
friend class TextDocumentLine;
|
||||
|
@ -299,6 +300,8 @@ private:
|
|||
virtual Vector<TextDocumentSpan>& spans() final { return document().spans(); }
|
||||
virtual Vector<TextDocumentSpan> const& spans() const final { return document().spans(); }
|
||||
virtual void set_span_at_index(size_t index, TextDocumentSpan span) final { document().set_span_at_index(index, move(span)); }
|
||||
virtual Vector<GUI::TextDocumentFoldingRegion>& folding_regions() final { return document().folding_regions(); };
|
||||
virtual Vector<GUI::TextDocumentFoldingRegion> const& folding_regions() const final { return document().folding_regions(); };
|
||||
virtual void highlighter_did_request_update() final { update(); }
|
||||
virtual DeprecatedString highlighter_did_request_text() const final { return text(); }
|
||||
virtual GUI::TextDocument& highlighter_did_request_document() final { return document(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue