Fix auto indent feature of BTextView. The indent was inserted before the line

break instead of after. Also whitespace after the cursor position wasn't
ignored.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32993 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2009-09-08 03:46:37 +00:00
parent 50a8c7c63e
commit 58465926de

View File

@ -3627,14 +3627,13 @@ BTextView::_HandleAlphaKey(const char *bytes, int32 numBytes)
start = offset = OffsetAt(_LineAt(fSelStart));
while (ByteAt(offset) != '\0' &&
(ByteAt(offset) == B_TAB || ByteAt(offset) == B_SPACE))
(ByteAt(offset) == B_TAB || ByteAt(offset) == B_SPACE)
&& offset < fSelStart)
offset++;
_DoInsertText(bytes, numBytes, fSelStart, NULL);
if (start != offset)
_DoInsertText(Text() + start, offset - start, fSelStart, NULL);
_DoInsertText(bytes, numBytes, fSelStart, NULL);
} else
_DoInsertText(bytes, numBytes, fSelStart, NULL);