mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
simplify JoinedCellData
This commit is contained in:
@@ -261,7 +261,10 @@ export abstract class BaseRenderLayer implements IRenderLayer {
|
||||
*/
|
||||
protected drawChars(terminal: ITerminal, cell: ICellData, x: number, y: number): void {
|
||||
|
||||
// skip cache right away if we draw in RGB or have joined cells
|
||||
// skip cache right away if we draw in RGB
|
||||
// Note: to avoid bad runtime JoinedCellData will be skipped
|
||||
// in the cache handler (atlasDidDraw == false) itself and
|
||||
// fall through to uncached later down below
|
||||
if (cell.isFgRGB() || cell.isBgRGB() || cell instanceof JoinedCellData) {
|
||||
this._drawUncachedChars(terminal, cell, x, y);
|
||||
return;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { ITerminal, IBufferLine, ICellData, CharData } from '../Types';
|
||||
import { ICharacterJoinerRegistry, ICharacterJoiner } from './Types';
|
||||
import { CellData, Content } from '../BufferLine';
|
||||
import { CellData, Content, AttributeData } from '../BufferLine';
|
||||
import { WHITESPACE_CELL_CHAR } from '../Buffer';
|
||||
|
||||
export class JoinedCellData extends CellData implements ICellData {
|
||||
private _width: number = 0;
|
||||
private _code: number = 0x1FFFFF; // highest allowed codepoint, meant as -1
|
||||
|
||||
export class JoinedCellData extends AttributeData implements ICellData {
|
||||
private _width: number;
|
||||
// .content carries no meaning for joined CellData, simply nullify it
|
||||
// thus we have to overload all other .content accessors
|
||||
public content: number = 0;
|
||||
public fg: number = 0;
|
||||
public bg: number = 0;
|
||||
public fg: number;
|
||||
public bg: number;
|
||||
public combinedData: string = '';
|
||||
|
||||
constructor(firstCell: ICellData, chars: string, width: number) {
|
||||
@@ -34,7 +34,9 @@ export class JoinedCellData extends CellData implements ICellData {
|
||||
}
|
||||
|
||||
public getCode(): number {
|
||||
return this._code;
|
||||
// code always gets the highest possible fake codepoint (read as -1)
|
||||
// this is needed as code is used by caches as identifier
|
||||
return 0x1FFFFF;
|
||||
}
|
||||
|
||||
public setFromCharData(value: CharData): void {
|
||||
|
||||
Reference in New Issue
Block a user