fix dom renderer

This commit is contained in:
Jörg Breitbart
2018-10-31 15:30:29 +01:00
parent 745e228e98
commit cabd4a721c
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -121,8 +121,9 @@ export class BufferLine implements IBufferLine {
public translateToString(trimRight: boolean = false, startCol: number = 0, endCol: number = null): string {
let length = endCol || this.length;
if (trimRight)
if (trimRight) {
length = Math.min(length, this.getTrimmedLength());
}
let result = '';
while (startCol < length) {
result += this.get(startCol)[CHAR_DATA_CHAR_INDEX] || ' ';
@@ -313,8 +314,9 @@ export class BufferLineTypedArray implements IBufferLine {
public translateToString(trimRight: boolean = false, startCol: number = 0, endCol: number = null): string {
let length = endCol || this.length;
if (trimRight)
if (trimRight) {
length = Math.min(length, this.getTrimmedLength());
}
let result = '';
while (startCol < length) {
const stringData = this._data[startCol * CELL_SIZE + Cell.STRING];
+1 -1
View File
@@ -31,7 +31,7 @@ export class DomRendererRowFactory {
}
const charData = lineData.get(x);
const char: string = charData[CHAR_DATA_CHAR_INDEX];
const char: string = charData[CHAR_DATA_CHAR_INDEX] || ' ';
const attr: number = charData[CHAR_DATA_ATTR_INDEX];
const width: number = charData[CHAR_DATA_WIDTH_INDEX];