diff options
author | Itamar <itamar8910@gmail.com> | 2021-02-20 12:16:32 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-20 15:53:37 +0100 |
commit | c4139be4611f08dcf40db5c2969852141c51b04d (patch) | |
tree | 5a023def18b4ba3cd707aa4f450814af1a8e2bb6 /Userland/DevTools/HackStudio/HackStudioWidget.cpp | |
parent | 7ecb21afa721cd950acb62329da49386d33bcf8a (diff) | |
download | serenity-c4139be4611f08dcf40db5c2969852141c51b04d.zip |
HackStudio: Always use relative paths when opening project files
Diffstat (limited to 'Userland/DevTools/HackStudio/HackStudioWidget.cpp')
-rw-r--r-- | Userland/DevTools/HackStudio/HackStudioWidget.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 97d75973aa..bbceccb44e 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -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; |