1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-02 22:42:08 +00:00

HackStudio: Always use relative paths when opening project files

This commit is contained in:
Itamar 2021-02-20 12:16:32 +02:00 committed by Andreas Kling
parent 7ecb21afa7
commit c4139be461
2 changed files with 6 additions and 2 deletions

View file

@ -210,8 +210,13 @@ Vector<String> HackStudioWidget::selected_file_names() const
return files;
}
void HackStudioWidget::open_file(const String& filename)
void HackStudioWidget::open_file(const String& full_filename)
{
String filename = full_filename;
if (full_filename.starts_with(project().root_path())) {
filename = LexicalPath::relative_path(full_filename, project().root_path());
}
dbgln("HackStudio is opening {}", filename);
if (Core::File::is_directory(filename))
return;