feature: supports open selected revision file with default editor (#674)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2024-11-11 09:37:27 +08:00
parent 06656f625e
commit 67cf23267a
No known key found for this signature in database

View file

@ -384,6 +384,16 @@ namespace SourceGit.ViewModels
ev.Handled = true;
};
var openWith = new MenuItem();
openWith.Header = App.Text("OpenWith");
openWith.Icon = App.CreateMenuIcon("Icons.OpenWith");
openWith.IsEnabled = File.Exists(fullPath);
openWith.Click += (_, ev) =>
{
Native.OS.OpenWithDefaultEditor(fullPath);
ev.Handled = true;
};
var saveAs = new MenuItem();
saveAs.Header = App.Text("SaveAs");
saveAs.Icon = App.CreateMenuIcon("Icons.Save");
@ -413,6 +423,7 @@ namespace SourceGit.ViewModels
};
menu.Items.Add(explore);
menu.Items.Add(openWith);
menu.Items.Add(saveAs);
menu.Items.Add(new MenuItem() { Header = "-" });