-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
34 lines (30 loc) · 874 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using SimpleTermEditor.Utility;
namespace SimpleTermEditor;
public class Program
{
/// <summary>
/// A simple editor that supports basic text editing and navigation.
/// </summary>
/// <param name="args"></param>
static void Main(string[] args)
{
// Either start a new file or open an existing file
Editor editor = new Editor();
if (args.Length > 0)
{
editor.Open(args[0]);
}
// The guidance message at the bottom
editor.SetStatusMessage("HELP: "
+ "Ctrl-S: Save | "
+ "Ctrl-Q: Quit | "
+ "Ctrl-F: Find "
);
// Refresh the screen and process non-writing operations
while (true)
{
editor.RefreshScreen();
editor.ProcessKeypress();
}
}
}