diff --git a/.gitignore b/.gitignore index 0738195..fa4c7b8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ riderModule.iml build-dir dist/ +#Visual Studio +.vs/ +**/Properties/launchSettings.json \ No newline at end of file diff --git a/src/PandocGui/ViewModels/MainWindowViewModel.cs b/src/PandocGui/ViewModels/MainWindowViewModel.cs index 79b6af9..149c742 100644 --- a/src/PandocGui/ViewModels/MainWindowViewModel.cs +++ b/src/PandocGui/ViewModels/MainWindowViewModel.cs @@ -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 GetInstalledFonts() => SKFontManager.Default.FontFamilies.ToList();