This project is a helper for Openning Any text Editor to a File/Line/Column.
Blitz.GotoEditor features:
- Listing builtin editors
- Expands Environment variables
- Built in Aliases that you can list in your UI
- Intstall the Blitz.Goto Package from your nuget package manager.
-
Create an empty console Appliction.
-
Add a the nuget reference to the latest version:
<PackageReference Include="Blitz.GotoEditor" Version="x.y.z.t" />
-
List Built in Editors
var definitions = new GotoDefinitions();
foreach (var edit in new GotoDefinitions().GetBuiltInEditors())
{
Console.WriteLine($"Title: {edit.Title} -> {Path.Combine(edit.ExecutableWorkingDirectory, edit.Executable)} {edit.Arguments}");
}
- Select Notepad++ from the list
var firstEditor = definitions.GetBuiltInEditors().FirstOrDefault(def => def.Title == "Notepad++")!;
- Create a Goto Action from the Editor. Goto Action takes care of translating the tags and environment variables.
var gotoAction = new GotoAction(firstEditor);
- Define what you want to go to. CreateAndTestFile will create a temp file path that you can test Goto Functionality with.
new GotoTestFile().CreateAndTestFile(out var myFileName,out var lineNumber, out var columnNumber );
- Create a directive for the goto action.
var directive = new GotoDirective(myFileName, lineNumber, columnNumber);
- Execute goto
gotoAction.ExecuteGoto(directive);