Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Editor/ZedDiscovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public CodeEditor.Installation[] GetInstallations()

// [Linux] (Official Website)
(NPath.HomeDirectory.Combine(".local/bin/zed"), null),

// [Windows] (Official Website)
(NPath.HomeDirectory.Combine("AppData/Local/Programs/Zed/Zed.exe"), null),
};

foreach (var candidate in candidates)
Expand All @@ -50,7 +53,7 @@ public CodeEditor.Installation[] GetInstallations()
results.Add(new()
{
Name = name.ToString(),
Path = candidatePath.MakeAbsolute().ToString(),
Path = candidatePath.MakeAbsolute().ToString(SlashMode.Native),
});

break;
Expand Down
11 changes: 8 additions & 3 deletions Editor/ZedProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@ public bool OpenProject(string filePath = "", int line = -1, int column = -1)
sLogger.Log("OpenProject");

// always add project path
var args = new StringBuilder($"\"{m_ProjectPath}\"");
var args = new StringBuilder($"\"{m_ProjectPath.ToString(SlashMode.Native)}\"");

// if file path is provided, add it too
if (!string.IsNullOrEmpty(filePath))
{
#if UNITY_EDITOR_WIN
args.Append(" /a ");
#else
args.Append(" -a ");
args.Append($"\"{filePath}\"");
#endif
args.Append($"\"{filePath}");

if (line >= 0)
{
Expand All @@ -42,9 +46,10 @@ public bool OpenProject(string filePath = "", int line = -1, int column = -1)
args.Append(column);
}
}
args.Append("\"");
}

return CodeEditor.OSOpenFile(m_ExecPath.ToString(), args.ToString());
return CodeEditor.OSOpenFile(m_ExecPath.ToString(SlashMode.Native), args.ToString());
}
}
}