diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp index c846b340d8..1aa190ef41 100644 --- a/Userland/DevTools/HackStudio/Editor.cpp +++ b/Userland/DevTools/HackStudio/Editor.cpp @@ -542,7 +542,7 @@ void Editor::LanguageServerAidedAutocompleteProvider::provide_completions(Functi data.value().position.column()); } -void Editor::will_execute(GUI::TextDocumentUndoCommand const& command) +void Editor::after_execute(GUI::TextDocumentUndoCommand const& command) { if (!m_language_client) return; @@ -568,7 +568,7 @@ void Editor::will_execute(GUI::TextDocumentUndoCommand const& command) return; } - VERIFY_NOT_REACHED(); + flush_file_content_to_langauge_server(); } void Editor::undo() diff --git a/Userland/DevTools/HackStudio/Editor.h b/Userland/DevTools/HackStudio/Editor.h index 24f4180785..7c29ac6db4 100644 --- a/Userland/DevTools/HackStudio/Editor.h +++ b/Userland/DevTools/HackStudio/Editor.h @@ -50,7 +50,7 @@ public: CodeDocument& code_document(); virtual void set_document(GUI::TextDocument&) override; - virtual void will_execute(GUI::TextDocumentUndoCommand const&) override; + virtual void after_execute(GUI::TextDocumentUndoCommand const&) override; virtual void undo() override; virtual void redo() override; diff --git a/Userland/Libraries/LibGUI/TextEditor.h b/Userland/Libraries/LibGUI/TextEditor.h index 55ddc8946a..8ffd9e037d 100644 --- a/Userland/Libraries/LibGUI/TextEditor.h +++ b/Userland/Libraries/LibGUI/TextEditor.h @@ -380,12 +380,12 @@ private: { auto command = make(*m_document, forward(args)...); command->perform_formatting(*this); - will_execute(*command); command->execute_from(*this); + after_execute(*command); m_document->add_to_undo_stack(move(command)); } - virtual void will_execute(TextDocumentUndoCommand const&) { } + virtual void after_execute(TextDocumentUndoCommand const&) { } void on_search_results(GUI::TextRange current, Vector all_results); static constexpr auto search_results_span_collection_index = 1;