mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 16:15:10 +00:00
LibGUI: Make autoformatting performed on InsertTextCommand visible to on_edit_action
This commit is contained in:
parent
4232874270
commit
8dc0d9b7b7
3 changed files with 65 additions and 44 deletions
|
@ -194,6 +194,7 @@ public:
|
|||
Optional<size_t> last_non_whitespace_column() const;
|
||||
bool ends_in_whitespace() const;
|
||||
bool is_empty() const { return length() == 0; }
|
||||
size_t leading_spaces() const;
|
||||
|
||||
private:
|
||||
// NOTE: This vector is null terminated.
|
||||
|
@ -204,6 +205,7 @@ class TextDocumentUndoCommand : public Command {
|
|||
public:
|
||||
TextDocumentUndoCommand(TextDocument&);
|
||||
virtual ~TextDocumentUndoCommand();
|
||||
virtual void perform_formatting(const TextDocument::Client&) { }
|
||||
|
||||
void execute_from(const TextDocument::Client& client)
|
||||
{
|
||||
|
@ -220,6 +222,7 @@ protected:
|
|||
class InsertTextCommand : public TextDocumentUndoCommand {
|
||||
public:
|
||||
InsertTextCommand(TextDocument&, const String&, const TextPosition&);
|
||||
virtual void perform_formatting(const TextDocument::Client&) override;
|
||||
virtual void undo() override;
|
||||
virtual void redo() override;
|
||||
virtual bool is_insert_text() const override { return true; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue