fix for support autoindent at first line

This commit is contained in:
Vadim Lopatin 2017-09-04 14:33:32 +03:00
parent 62a58b8bf5
commit 7da5ca6108
1 changed files with 2 additions and 2 deletions

View File

@ -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;