diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 89329fd75..31a0081a8 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3640,7 +3640,7 @@ void Notepad_plus::maintainIndentation(TCHAR ch) auto startPos = _pEditView->execute(SCI_POSITIONFROMLINE, curLine); LRESULT endPos = _pEditView->execute(SCI_GETCURRENTPOS); - for (LRESULT i = endPos - 2; i > 0 && i > startPos; --i) + for (LRESULT i = endPos - 2; i > 0 && i >= startPos; --i) { UCHAR aChar = (UCHAR)_pEditView->execute(SCI_GETCHARAT, i); if (aChar != ' ' && aChar != '\t')