mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
HackStudio: Properly close previous project when opening a new one
Previously files in the open files view would stay open from the previous project, and files in the new project with the same name as files in the old one would be inaccessible, with the old ones showing up instead. Now all files and open editors are closed before a new project is opened. Fixes #9103
This commit is contained in:
parent
2faa73ff7d
commit
28b1e66b51
Notes:
sideshowbarker
2024-07-18 07:39:24 +09:00
Author: https://github.com/donaghylennon Commit: https://github.com/SerenityOS/serenity/commit/28b1e66b51e Pull-request: https://github.com/SerenityOS/serenity/pull/9147 Issue: https://github.com/SerenityOS/serenity/issues/9103
1 changed files with 7 additions and 0 deletions
|
@ -192,6 +192,13 @@ void HackStudioWidget::open_project(const String& root_path)
|
|||
perror("chdir");
|
||||
exit(1);
|
||||
}
|
||||
if (m_project) {
|
||||
m_editors_splitter->remove_all_children();
|
||||
m_all_editor_wrappers.clear();
|
||||
m_open_files.clear();
|
||||
m_open_files_vector.clear();
|
||||
add_new_editor(*m_editors_splitter);
|
||||
}
|
||||
m_project = Project::open_with_root_path(root_path);
|
||||
VERIFY(m_project);
|
||||
if (m_project_tree_view) {
|
||||
|
|
Loading…
Reference in a new issue