diff --git a/GUI.NET/Debugger/Controls/ctrlTextbox.cs b/GUI.NET/Debugger/Controls/ctrlTextbox.cs index 021dafc1..0ae516d5 100644 --- a/GUI.NET/Debugger/Controls/ctrlTextbox.cs +++ b/GUI.NET/Debugger/Controls/ctrlTextbox.cs @@ -270,7 +270,7 @@ namespace Mesen.GUI.Debugger [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public int CursorPosition { - get { return _cursorPosition; } + get { return Math.Min(this._contents.Length - 1, Math.Max(0, _cursorPosition)); } set { _cursorPosition = Math.Min(this._contents.Length - 1, Math.Max(0, value));