From 7da5ca6108e6b31e72911e56a6dd0ec622aa1354 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Mon, 4 Sep 2017 14:33:32 +0300 Subject: [PATCH] fix for support autoindent at first line --- src/dlangui/core/editable.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;