Skip to content

Commit

Permalink
Merge pull request #23 from oxygen-dioxide/openfile
Browse files Browse the repository at this point in the history
Support opening a file with Pandoc GUI
  • Loading branch information
Ombrelin authored Dec 14, 2022
2 parents a5b6065 + 9ac5341 commit 1189875
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ riderModule.iml
build-dir
dist/

#Visual Studio
.vs/
**/Properties/launchSettings.json
7 changes: 7 additions & 0 deletions src/PandocGui/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ public MainWindowViewModel(IFileDialogService fileDialogService, IPandocCli pand
OpenLogFolderCommand = ReactiveCommand.Create(dataDirectoryService.OpenLogFolder);

InstalledFonts = GetInstalledFonts();

//auto set SourcePath as the file user opened.
var args = Environment.GetCommandLineArgs();
if (args.Count() > 1 && File.Exists(args[1]))
{
this.SourcePath= args[1];
}
}

private static List<string> GetInstalledFonts() => SKFontManager.Default.FontFamilies.ToList();
Expand Down

0 comments on commit 1189875

Please sign in to comment.