mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-09 04:37:52 +03:00
HackStudio: Convert selected path to a relative path on 'Save as...'
This makes the editor title a bit more consistent with the other files and removes duplicating the file name in the file history when reopening that file.
This commit is contained in:
parent
9bef96748d
commit
90396f5b08
Notes:
sideshowbarker
2024-07-19 17:18:29 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/90396f5b08f Pull-request: https://github.com/SerenityOS/serenity/pull/9404 Reviewed-by: https://github.com/itamar8910 ✅
@ -652,12 +652,13 @@ NonnullRefPtr<GUI::Action> HackStudioWidget::create_save_as_action()
|
||||
return;
|
||||
}
|
||||
|
||||
current_editor_wrapper().set_filename(save_path.value());
|
||||
String const relative_file_path = LexicalPath::relative_path(save_path.value(), m_project->root_path());
|
||||
current_editor_wrapper().set_filename(relative_file_path);
|
||||
current_editor_wrapper().save();
|
||||
|
||||
auto new_project_file = m_project->get_file(save_path.value());
|
||||
m_open_files.set(save_path.value(), *new_project_file);
|
||||
m_open_files_vector.append(save_path.value());
|
||||
auto new_project_file = m_project->get_file(relative_file_path);
|
||||
m_open_files.set(relative_file_path, *new_project_file);
|
||||
m_open_files_vector.append(relative_file_path);
|
||||
|
||||
update_window_title();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user