diff options
Diffstat (limited to 'Userland/Libraries/LibGUI/TextDocument.h')
-rw-r--r-- | Userland/Libraries/LibGUI/TextDocument.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/TextDocument.h b/Userland/Libraries/LibGUI/TextDocument.h index c26bad0890..912354f04d 100644 --- a/Userland/Libraries/LibGUI/TextDocument.h +++ b/Userland/Libraries/LibGUI/TextDocument.h @@ -246,6 +246,27 @@ private: TextRange m_range; }; +class InsertLineCommand : public TextDocumentUndoCommand { +public: + enum class InsertPosition { + Above, + Below, + }; + + InsertLineCommand(TextDocument&, TextPosition, DeprecatedString&&, InsertPosition); + virtual ~InsertLineCommand() = default; + virtual void undo() override; + virtual void redo() override; + virtual DeprecatedString action_text() const override; + +private: + size_t compute_line_number() const; + + TextPosition m_cursor; + DeprecatedString m_text; + InsertPosition m_pos; +}; + class ReplaceAllTextCommand final : public GUI::TextDocumentUndoCommand { public: |