1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 23:42:13 +00:00

GTextEditor: Give Line objects a back-reference to the GTextEditor

This will allow us to do more complicated things in Line without having
to pass the editor around all the time.
This commit is contained in:
Andreas Kling 2019-08-21 19:32:39 +02:00
parent 0b3308f995
commit 9e5c5627d5
2 changed files with 15 additions and 11 deletions

View file

@ -167,8 +167,8 @@ private:
friend class GTextEditor;
public:
Line();
explicit Line(const StringView&);
explicit Line(GTextEditor&);
Line(GTextEditor&, const StringView&);
const char* characters() const { return m_text.data(); }
int length() const { return m_text.size() - 1; }
@ -183,6 +183,8 @@ private:
void clear();
private:
GTextEditor& m_editor;
// NOTE: This vector is null terminated.
Vector<char> m_text;
};