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:
@@ -3627,14 +3627,13 @@ BTextView::_HandleAlphaKey(const char *bytes, int32 numBytes)
|
|||||||
start = offset = OffsetAt(_LineAt(fSelStart));
|
start = offset = OffsetAt(_LineAt(fSelStart));
|
||||||
|
|
||||||
while (ByteAt(offset) != '\0' &&
|
while (ByteAt(offset) != '\0' &&
|
||||||
(ByteAt(offset) == B_TAB || ByteAt(offset) == B_SPACE))
|
(ByteAt(offset) == B_TAB || ByteAt(offset) == B_SPACE)
|
||||||
|
&& offset < fSelStart)
|
||||||
offset++;
|
offset++;
|
||||||
|
|
||||||
|
_DoInsertText(bytes, numBytes, fSelStart, NULL);
|
||||||
if (start != offset)
|
if (start != offset)
|
||||||
_DoInsertText(Text() + start, offset - start, fSelStart, NULL);
|
_DoInsertText(Text() + start, offset - start, fSelStart, NULL);
|
||||||
|
|
||||||
_DoInsertText(bytes, numBytes, fSelStart, NULL);
|
|
||||||
|
|
||||||
} else
|
} else
|
||||||
_DoInsertText(bytes, numBytes, fSelStart, NULL);
|
_DoInsertText(bytes, numBytes, fSelStart, NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user