1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:57:35 +00:00

LibGUI+GMLPlayground: Replace text using ReplaceAllTextCommand

This commit is contained in:
SimonFJ20 2022-04-12 22:46:26 +02:00 committed by Andreas Kling
parent 343d699627
commit 661e7d691e
5 changed files with 65 additions and 1 deletions

View file

@ -236,4 +236,20 @@ private:
TextRange m_range;
};
class ReplaceAllTextCommand : public GUI::TextDocumentUndoCommand {
public:
ReplaceAllTextCommand(GUI::TextDocument& document, String const& text, GUI::TextRange const& range);
void redo() override;
void undo() override;
bool merge_with(GUI::Command const&) override;
String action_text() const override;
String const& text() const { return m_text; }
TextRange const& range() const { return m_range; }
private:
String m_text;
GUI::TextRange m_range;
};
}