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
commit 57f7009b9e
Notes: sideshowbarker 2024-07-19 11:12:56 +09:00
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);