mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
HackStudio: Remove an old file from the vectors in 'Save as...' action
If you saved a file under a different name and then went back to the first file, then you had the same TextDocument buffer, and therefore the same changes to the file as in the new one.
This commit is contained in:
parent
d811ad921c
commit
6c5fb2ca63
Notes:
sideshowbarker
2024-07-19 17:13:04 +09:00
Author: https://github.com/krkk
Commit: 6c5fb2ca63
Pull-request: https://github.com/SerenityOS/serenity/pull/9860
Reviewed-by: https://github.com/itamar8910 ✅
1 changed files with 3 additions and 0 deletions
|
@ -701,7 +701,10 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_save_as_action()
|
|||
|
||||
auto new_project_file = m_project->create_file(relative_file_path);
|
||||
m_open_files.set(relative_file_path, *new_project_file);
|
||||
m_open_files.remove(old_filename);
|
||||
|
||||
m_open_files_vector.append(relative_file_path);
|
||||
m_open_files_vector.remove_all_matching([&old_filename](auto const& element) { return element == old_filename; });
|
||||
|
||||
update_window_title();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue