summaryrefslogtreecommitdiff
path: root/Userland/DevTools/HackStudio
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-08 15:52:37 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-08 22:17:50 +0200
commit244665d99c3acb43081e44f6a88523388761e37e (patch)
treeea3c33bfa0fd76c1b938eef573b2e95b06d1b110 /Userland/DevTools/HackStudio
parentaaa96e909bf31d59eac32794a2cbe1d886961865 (diff)
downloadserenity-244665d99c3acb43081e44f6a88523388761e37e.zip
LibGUI: Some tweaks for TextEditor's will-execute-command virtual
Renamed the virtual from "on_edit_action" to "will_execute" so it doesn't clash with our convention for Function hook names. Also tighten the parameter type to GUI::TextDocumentUndoCommand since that's the only kind of command it will receive.
Diffstat (limited to 'Userland/DevTools/HackStudio')
-rw-r--r--Userland/DevTools/HackStudio/Editor.cpp2
-rw-r--r--Userland/DevTools/HackStudio/Editor.h3
2 files changed, 2 insertions, 3 deletions
diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp
index 10c56ea5d8..b6430087ee 100644
--- a/Userland/DevTools/HackStudio/Editor.cpp
+++ b/Userland/DevTools/HackStudio/Editor.cpp
@@ -488,7 +488,7 @@ void Editor::LanguageServerAidedAutocompleteProvider::provide_completions(Functi
data.value().position.column());
}
-void Editor::on_edit_action(const GUI::Command& command)
+void Editor::will_execute(GUI::TextDocumentUndoCommand const& command)
{
if (!m_language_client)
return;
diff --git a/Userland/DevTools/HackStudio/Editor.h b/Userland/DevTools/HackStudio/Editor.h
index 1e5b197c20..036287f97b 100644
--- a/Userland/DevTools/HackStudio/Editor.h
+++ b/Userland/DevTools/HackStudio/Editor.h
@@ -41,8 +41,7 @@ public:
CodeDocument& code_document();
virtual void set_document(GUI::TextDocument&) override;
-
- virtual void on_edit_action(const GUI::Command&) override;
+ virtual void will_execute(GUI::TextDocumentUndoCommand const&) override;
virtual void undo() override;
virtual void redo() override;