mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-04 09:06:41 +02:00
Automatically redraw console window when size chnages
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Timers;
|
||||||
|
|
||||||
using YesNt.Interpreter.Runtime;
|
using YesNt.Interpreter.Runtime;
|
||||||
|
|
||||||
@@ -36,6 +37,22 @@ internal class TextEditor
|
|||||||
syntaxHighlighter = new(YesNtInterpreter.StatementInformation);
|
syntaxHighlighter = new(YesNtInterpreter.StatementInformation);
|
||||||
inputHandler = new InputHandler(this);
|
inputHandler = new InputHandler(this);
|
||||||
Console.CancelKeyPress += Console_CancelKeyPress;
|
Console.CancelKeyPress += Console_CancelKeyPress;
|
||||||
|
|
||||||
|
Timer timer = new Timer(500);
|
||||||
|
timer.Elapsed += (s, e) =>
|
||||||
|
{
|
||||||
|
if (SizeChanged() && EditMode != Mode.Debug)
|
||||||
|
{
|
||||||
|
Display(true);
|
||||||
|
|
||||||
|
if (EditMode == Mode.Command)
|
||||||
|
{
|
||||||
|
InputHandler.WriteStatus(string.Empty);
|
||||||
|
Console.SetCursorPosition(3, Console.WindowHeight - 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
timer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run()
|
public void Run()
|
||||||
|
|||||||
Reference in New Issue
Block a user