diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-08 13:16:37 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-08 13:49:34 +0200 |
commit | ee19f7c0aac48b1ca6527413552fc05a4fe16710 (patch) | |
tree | 63d2767702e5a289e77f8c336a830cf61a2d77a8 /Userland/Libraries/LibGUI/TextDocument.h | |
parent | 0cb610392823b9591479da4492e9ba964df91141 (diff) | |
download | serenity-ee19f7c0aac48b1ca6527413552fc05a4fe16710.zip |
LibGUI: Use UndoStack::on_state_change inside TextDocument/TextEditor
Have TextDocument listen for state changes on the internal undo stack,
and forward those to all clients via a new virtual function.
This simplifies updating the can_undo / can_redo states of TextEditor.
Diffstat (limited to 'Userland/Libraries/LibGUI/TextDocument.h')
-rw-r--r-- | Userland/Libraries/LibGUI/TextDocument.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/TextDocument.h b/Userland/Libraries/LibGUI/TextDocument.h index fa1b7beeef..aac61254fb 100644 --- a/Userland/Libraries/LibGUI/TextDocument.h +++ b/Userland/Libraries/LibGUI/TextDocument.h @@ -47,6 +47,7 @@ public: virtual void document_did_change() = 0; virtual void document_did_set_text() = 0; virtual void document_did_set_cursor(const TextPosition&) = 0; + virtual void document_did_update_undo_stack() = 0; virtual bool is_automatic_indentation_enabled() const = 0; virtual int soft_tab_width() const = 0; |