diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaControl.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaControl.cs index 06734e8a62..18624d42a8 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaControl.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextAreaControl.cs @@ -442,5 +442,13 @@ namespace ICSharpCode.TextEditor } base.WndProc(ref m); } + + protected override void OnEnter(EventArgs e) + { + // SD2-1072 - Make sure the caret line is valid if anyone + // has handlers for the Enter event. + Caret.ValidateCaretPos(); + base.OnEnter(e); + } } }