diff --git a/VKT5_RemoteConsole/Vkt5ConsoleControl.cs b/VKT5_RemoteConsole/Vkt5ConsoleControl.cs index efbaad5..9965be5 100644 --- a/VKT5_RemoteConsole/Vkt5ConsoleControl.cs +++ b/VKT5_RemoteConsole/Vkt5ConsoleControl.cs @@ -337,10 +337,11 @@ namespace Vkt5_RemoteConsole string showLine = this.displayLine; - if (this.displayCursor) + if (showLine.Length > 0 && cursorPos < showLine.Length && this.displayCursor) { - showLine = showLine.Remove(this.cursorPos, 1); - showLine = showLine.Insert(this.cursorPos, cursorChar); + showLine = showLine + .Remove(this.cursorPos, 1) + .Insert(this.cursorPos, cursorChar); } this.txtLine1.Text = showLine.Substring(0, 16); @@ -379,4 +380,4 @@ namespace Vkt5_RemoteConsole private bool isMenuBtnDown = false; private DateTime menuBtnPressTime = DateTime.MinValue; } -} +} \ No newline at end of file