diff --git a/src/dlangui/core/editable.d b/src/dlangui/core/editable.d index 3f7ae4af..712dda8e 100644 --- a/src/dlangui/core/editable.d +++ b/src/dlangui/core/editable.d @@ -829,11 +829,11 @@ class EditableContent { /// returns previous character position TextPosition prevCharPos(TextPosition p) { - if (p.line <= 0) + if (p.line < 0) return TextPosition(0, 0); p.pos--; for (;;) { - if (p.line <= 0) + if (p.line < 0) return TextPosition(0, 0); if (p.pos >= 0 && p.pos < lineLength(p.line)) return p;