mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
style: add .editorconfig for code formatting. see issu #25
This commit is contained in:
parent
a8eeea4f78
commit
18aaa0a143
225 changed files with 7781 additions and 3911 deletions
|
@ -1,15 +1,20 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.Versioning;
|
||||
using System.Text;
|
||||
|
||||
namespace SourceGit.Native {
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Native
|
||||
{
|
||||
[SupportedOSPlatform("macOS")]
|
||||
internal class MacOS : OS.IBackend {
|
||||
public void SetupApp(AppBuilder builder) {
|
||||
builder.With(new FontManagerOptions() {
|
||||
internal class MacOS : OS.IBackend
|
||||
{
|
||||
public void SetupApp(AppBuilder builder)
|
||||
{
|
||||
builder.With(new FontManagerOptions()
|
||||
{
|
||||
DefaultFamilyName = "PingFang SC",
|
||||
FontFallbacks = [
|
||||
new FontFallback { FontFamily = new FontFamily("PingFang SC") }
|
||||
|
@ -17,32 +22,41 @@ namespace SourceGit.Native {
|
|||
});
|
||||
}
|
||||
|
||||
public string FindGitExecutable() {
|
||||
public string FindGitExecutable()
|
||||
{
|
||||
if (File.Exists("/usr/bin/git")) return "/usr/bin/git";
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public string FindVSCode() {
|
||||
if (File.Exists("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code")) {
|
||||
public string FindVSCode()
|
||||
{
|
||||
if (File.Exists("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"))
|
||||
{
|
||||
return "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code";
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public void OpenBrowser(string url) {
|
||||
public void OpenBrowser(string url)
|
||||
{
|
||||
Process.Start("open", url);
|
||||
}
|
||||
|
||||
public void OpenInFileManager(string path, bool select) {
|
||||
if (Directory.Exists(path)) {
|
||||
public void OpenInFileManager(string path, bool select)
|
||||
{
|
||||
if (Directory.Exists(path))
|
||||
{
|
||||
Process.Start("open", path);
|
||||
} else if (File.Exists(path)) {
|
||||
}
|
||||
else if (File.Exists(path))
|
||||
{
|
||||
Process.Start("open", $"\"{path}\" -R");
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenTerminal(string workdir) {
|
||||
public void OpenTerminal(string workdir)
|
||||
{
|
||||
var dir = string.IsNullOrEmpty(workdir) ? "~" : workdir;
|
||||
var builder = new StringBuilder();
|
||||
builder.AppendLine("on run argv");
|
||||
|
@ -59,8 +73,9 @@ namespace SourceGit.Native {
|
|||
proc.Exited += (o, e) => File.Delete(tmp);
|
||||
}
|
||||
|
||||
public void OpenWithDefaultEditor(string file) {
|
||||
public void OpenWithDefaultEditor(string file)
|
||||
{
|
||||
Process.Start("open", file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue