diff options
-rw-r--r-- | Userland/DevTools/HackStudio/Editor.cpp | 1 | ||||
-rw-r--r-- | Userland/DevTools/HackStudio/HackStudioWidget.cpp | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/Userland/DevTools/HackStudio/Editor.cpp b/Userland/DevTools/HackStudio/Editor.cpp index 5b346da5e2..c16d2980ee 100644 --- a/Userland/DevTools/HackStudio/Editor.cpp +++ b/Userland/DevTools/HackStudio/Editor.cpp @@ -431,7 +431,6 @@ void Editor::set_document(GUI::TextDocument& doc) if (m_language_client) { set_autocomplete_provider(make<LanguageServerAidedAutocompleteProvider>(*m_language_client)); - dbgln("Opening {}", code_document.file_path()); int fd = open(code_document.file_path().characters(), O_RDONLY | O_NOCTTY); if (fd < 0) { perror("open"); 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; |