mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibGUI+GMLPlayground: Replace text using ReplaceAllTextCommand
This commit is contained in:
parent
343d699627
commit
661e7d691e
5 changed files with 65 additions and 1 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue