diff --git a/DevTools/HackStudio/HackStudioWidget.cpp b/DevTools/HackStudio/HackStudioWidget.cpp index 2cd41c04a3..8c201c3904 100644 --- a/DevTools/HackStudio/HackStudioWidget.cpp +++ b/DevTools/HackStudio/HackStudioWidget.cpp @@ -351,7 +351,12 @@ NonnullRefPtr HackStudioWidget::create_delete_action() return; for (auto& file : files) { - if (!m_project->remove_file(file)) { + if (m_project->remove_file(file)) { + m_open_files_vector.remove_first_matching([&](auto& filename) { + return filename == file; + }); + m_open_files_view->model()->update(); + } else { GUI::MessageBox::show(window(), String::formatted("Removing file {} from the project failed.", file), "Removal failed",