mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Expose underline attrs as getter/setter
In preparation for storing them in a packed format for glyph caching
This commit is contained in:
@@ -30,7 +30,7 @@ export class AttributeData implements IAttributeData {
|
||||
// data
|
||||
public fg = 0;
|
||||
public bg = 0;
|
||||
public extended = new ExtendedAttrs();
|
||||
public extended: IExtendedAttrs = new ExtendedAttrs();
|
||||
|
||||
// flags
|
||||
public isInverse(): number { return this.fg & FgFlags.INVERSE; }
|
||||
@@ -127,12 +127,27 @@ export class AttributeData implements IAttributeData {
|
||||
* Holds information about different underline styles and color.
|
||||
*/
|
||||
export class ExtendedAttrs implements IExtendedAttrs {
|
||||
// underline style, NONE is empty
|
||||
private _underlineStyle: UnderlineStyle = UnderlineStyle.NONE;
|
||||
public get underlineStyle(): UnderlineStyle { return this._underlineStyle; }
|
||||
public set underlineStyle(value: UnderlineStyle) {
|
||||
this._underlineStyle = value;
|
||||
}
|
||||
|
||||
// underline color, -1 is empty (same as FG)
|
||||
private _underlineColor: number = -1;
|
||||
public get underlineColor(): number { return this._underlineColor; }
|
||||
public set underlineColor(value: number) {
|
||||
this._underlineColor = value;
|
||||
}
|
||||
|
||||
constructor(
|
||||
// underline style, NONE is empty
|
||||
public underlineStyle: UnderlineStyle = UnderlineStyle.NONE,
|
||||
// underline color, -1 is empty (same as FG)
|
||||
public underlineColor: number = -1
|
||||
) {}
|
||||
underlineStyle: UnderlineStyle = UnderlineStyle.NONE,
|
||||
underlineColor: number = -1
|
||||
) {
|
||||
this._underlineStyle = underlineStyle;
|
||||
this._underlineColor = underlineColor;
|
||||
}
|
||||
|
||||
public clone(): IExtendedAttrs {
|
||||
return new ExtendedAttrs(this.underlineStyle, this.underlineColor);
|
||||
|
||||
@@ -55,7 +55,7 @@ export const DEFAULT_ATTR_DATA = Object.freeze(new AttributeData());
|
||||
export class BufferLine implements IBufferLine {
|
||||
protected _data: Uint32Array;
|
||||
protected _combined: {[index: number]: string} = {};
|
||||
protected _extendedAttrs: {[index: number]: ExtendedAttrs} = {};
|
||||
protected _extendedAttrs: {[index: number]: IExtendedAttrs} = {};
|
||||
public length: number;
|
||||
|
||||
constructor(cols: number, fillCellData?: ICellData, public isWrapped: boolean = false) {
|
||||
|
||||
Reference in New Issue
Block a user