@@ -31,8 +31,12 @@ export class LigaturesAddon implements ITerminalAddon , ILigaturesApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public activate(terminal: Terminal): void {
|
public activate(terminal: Terminal): void {
|
||||||
|
if (!terminal.element) {
|
||||||
|
throw new Error('Cannot activate LigaturesAddon before open is called');
|
||||||
|
}
|
||||||
this._terminal = terminal;
|
this._terminal = terminal;
|
||||||
this._characterJoinerId = enableLigatures(terminal, this._fallbackLigatures);
|
this._characterJoinerId = enableLigatures(terminal, this._fallbackLigatures);
|
||||||
|
terminal.element.style.fontFeatureSettings = '"liga" on, "calt" on';
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
@@ -40,5 +44,8 @@ export class LigaturesAddon implements ITerminalAddon , ILigaturesApi {
|
|||||||
this._terminal?.deregisterCharacterJoiner(this._characterJoinerId);
|
this._terminal?.deregisterCharacterJoiner(this._characterJoinerId);
|
||||||
this._characterJoinerId = undefined;
|
this._characterJoinerId = undefined;
|
||||||
}
|
}
|
||||||
|
if (this._terminal?.element) {
|
||||||
|
this._terminal.element.style.fontFeatureSettings = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user