From 90a55ea21f98d46b88c2171ae879854017e9e7be Mon Sep 17 00:00:00 2001 From: James Johnson Date: Fri, 20 Apr 2018 06:25:24 -0400 Subject: [PATCH] Prevent range violation --- src/dlangui/widgets/editors.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index c82159bd..a1f96def 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -1686,7 +1686,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction _caretPos.pos++; updateSelectionAfterCursorMovement(oldCaretPos, (a.id & 1) != 0); ensureCaretVisible(); - } else if (_caretPos.line < _content.length && _content.multiline) { + } else if (_caretPos.line < _content.length - 1 && _content.multiline) { _caretPos.pos = 0; _caretPos.line++; updateSelectionAfterCursorMovement(oldCaretPos, (a.id & 1) != 0);