feature: supports Zed editor as an external editor (#477)

This commit is contained in:
leo 2024-09-18 10:00:32 +08:00
parent a00cf4f009
commit ba9c3058ed
No known key found for this signature in database
5 changed files with 8 additions and 0 deletions

View file

@ -111,6 +111,7 @@ This app supports open repository in external tools listed in the table below.
| VSCodium | YES | YES | YES | VSCODIUM |
| JetBrains Fleet | YES | YES | YES | FLEET |
| Sublime Text | YES | YES | YES | SUBLIME_TEXT |
| Zed | NO | YES | YES | ZED |
> [!NOTE]
> This app will try to find those tools based on some pre-defined or expected locations automatically. If you are using one portable version of these tools, it will not be detected by this app.

View file

@ -149,6 +149,11 @@ namespace SourceGit.Models
TryAdd("Sublime Text", "sublime_text", "\"{0}\"", "SUBLIME_TEXT", platformFinder);
}
public void Zed(Func<string> platformFinder)
{
TryAdd("Zed", "zed", "\"{0}\"", "ZED", platformFinder);
}
public void FindJetBrainsFromToolbox(Func<string> platformFinder)
{
var exclude = new List<string> { "fleet", "dotmemory", "dottrace", "resharper-u", "androidstudio" };

View file

@ -50,6 +50,7 @@ namespace SourceGit.Native
finder.Fleet(FindJetBrainsFleet);
finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}/JetBrains/Toolbox");
finder.SublimeText(() => FindExecutable("subl"));
finder.Zed(() => FindExecutable("zed"));
return finder.Founded;
}

View file

@ -46,6 +46,7 @@ namespace SourceGit.Native
finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Applications/Fleet.app/Contents/MacOS/Fleet");
finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Library/Application Support/JetBrains/Toolbox");
finder.SublimeText(() => "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl");
finder.Zed(() => File.Exists("/usr/local/bin/zed") ? "/usr/local/bin/zed" : "/Applications/Zed.app/Contents/MacOS/cli");
return finder.Founded;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB