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
commit 9e5c5627d5
Notes: sideshowbarker 2024-07-19 12:34:23 +09:00
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;
};