mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-08 16:06:07 +02:00
- Improve debug output
This commit is contained in:
@@ -197,17 +197,18 @@ namespace YesNt.CodeEditor
|
|||||||
{
|
{
|
||||||
Console.ForegroundColor = ConsoleColor.Magenta;
|
Console.ForegroundColor = ConsoleColor.Magenta;
|
||||||
|
|
||||||
string taskId = e.IsTask ? $"[Task: {e.TaskId}] " : string.Empty;
|
string sharedString = (Console.CursorLeft != 0) ? Environment.NewLine : string.Empty;
|
||||||
|
sharedString += e.IsTask ? $"[Task: {e.TaskId}] " : string.Empty + $"[{e.LineNumber}]";
|
||||||
|
|
||||||
if (e.OriginalLine == e.CurrentLine)
|
if (e.OriginalLine == e.CurrentLine)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{Environment.NewLine}{taskId}[{e.LineNumber}] [{e.CurrentLine}] ==>");
|
Console.WriteLine($"{sharedString}[{e.CurrentLine}] ==>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine($"{Environment.NewLine}{taskId}[{e.LineNumber}] [{e.OriginalLine}] => [{e.CurrentLine}] ==>");
|
Console.WriteLine($"{sharedString} [{e.OriginalLine}] => [{e.CurrentLine}] ==>");
|
||||||
}
|
}
|
||||||
Console.ForegroundColor = ConsoleColor.Gray;
|
Console.ForegroundColor = ConsoleColor.Gray;
|
||||||
|
|
||||||
}
|
}
|
||||||
string[] outputs = debugOutput.ToArray();
|
string[] outputs = debugOutput.ToArray();
|
||||||
debugOutput.Clear();
|
debugOutput.Clear();
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ namespace YesNt.CodeEditor
|
|||||||
{
|
{
|
||||||
internal class InputHandler
|
internal class InputHandler
|
||||||
{
|
{
|
||||||
private TextEditor textEditor;
|
private readonly TextEditor textEditor;
|
||||||
|
|
||||||
public InputHandler(TextEditor textEditor)
|
public InputHandler(TextEditor textEditor)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user