jix joined cell representation as overloaded CellData type

This commit is contained in:
Jörg Breitbart
2019-04-30 00:58:18 +02:00
parent 3f145b8a0c
commit 4fd9b3f249
3 changed files with 54 additions and 12 deletions
+6 -8
View File
@@ -9,6 +9,7 @@ import { CharData, ITerminal, ICellData } from '../Types';
import { GridCache } from './GridCache';
import { BaseRenderLayer } from './BaseRenderLayer';
import { CellData, AttributeData, Content } from '../BufferLine';
import { JoinedCellData } from './CharacterJoinerRegistry';
/**
* This CharData looks like a null character, which will forc a clear and render
@@ -89,15 +90,12 @@ export class TextRenderLayer extends BaseRenderLayer {
// We already know the exact start and end column of the joined range,
// so we get the string and width representing it directly
cell = CellData.fromCharData([
0,
cell = new JoinedCellData(
this._workCell,
line.translateToString(true, range[0], range[1]),
range[1] - range[0],
0xFFFFFF
]);
// hacky: patch attrs
cell.fg = this._workCell.fg;
cell.bg = this._workCell.bg;
range[1] - range[0]
);
// Skip over the cells occupied by this range in the loop
lastCharX = range[1] - 1;