mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 23:59:49 +00:00
HackStudio: Always use relative paths when opening project files
This commit is contained in:
parent
7ecb21afa7
commit
c4139be461
Notes:
sideshowbarker
2024-07-18 22:06:44 +09:00
Author: https://github.com/itamar8910
Commit: c4139be461
Pull-request: https://github.com/SerenityOS/serenity/pull/5424
Reviewed-by: https://github.com/awesomekling
2 changed files with 6 additions and 2 deletions
|
@ -431,7 +431,6 @@ void Editor::set_document(GUI::TextDocument& doc)
|
||||||
|
|
||||||
if (m_language_client) {
|
if (m_language_client) {
|
||||||
set_autocomplete_provider(make<LanguageServerAidedAutocompleteProvider>(*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);
|
int fd = open(code_document.file_path().characters(), O_RDONLY | O_NOCTTY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
perror("open");
|
perror("open");
|
||||||
|
|
|
@ -210,8 +210,13 @@ Vector<String> HackStudioWidget::selected_file_names() const
|
||||||
return files;
|
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))
|
if (Core::File::is_directory(filename))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue