Terminal: insert space on tab only at the end of the line.

This commit is contained in:
Jérôme Duval
2016-11-02 22:04:00 +01:00
parent 1674f60dae
commit 2085048ea9
@@ -745,9 +745,11 @@ BasicTerminalBuffer::InsertTab()
if (x != fCursor.x) { if (x != fCursor.x) {
TerminalLine* line = _LineAt(fCursor.y); TerminalLine* line = _LineAt(fCursor.y);
for (int32 i = fCursor.x; i <= x; i++) { for (int32 i = fCursor.x; i <= x; i++) {
if (line->length <= i) {
line->cells[i].character = ' '; line->cells[i].character = ' ';
line->cells[i].attributes = fAttributes; line->cells[i].attributes = fAttributes;
} }
}
fCursor.x = x; fCursor.x = x;
if (line->length < fCursor.x) if (line->length < fCursor.x)
line->length = fCursor.x; line->length = fCursor.x;