1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

GTextEditor: Allow GTextDocumentSpans to be "skippable"

Setting the is_skippable flag on a GTextDocumentSpan will now cause the
cursor to skip over that span when moving with Ctrl+Left/Right.
This commit is contained in:
Andreas Kling 2019-11-15 20:36:45 +01:00
parent 27a30fdc2a
commit 57f7009b9e
3 changed files with 56 additions and 26 deletions

View file

@ -15,6 +15,7 @@ class GTextDocumentLine;
struct GTextDocumentSpan {
GTextRange range;
Color color;
bool is_skippable { false };
const Font* font { nullptr };
};
@ -76,6 +77,9 @@ public:
char character_at(const GTextPosition&) const;
Optional<GTextDocumentSpan> first_non_skippable_span_before(const GTextPosition&) const;
Optional<GTextDocumentSpan> first_non_skippable_span_after(const GTextPosition&) const;
private:
explicit GTextDocument(Client* client);