mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
cleanup
This commit is contained in:
@@ -37,6 +37,7 @@ export class DomRenderer extends Disposable implements IRenderer {
|
||||
private _rowContainer: HTMLElement;
|
||||
private _rowElements: HTMLElement[] = [];
|
||||
private _selectionContainer: HTMLElement;
|
||||
private _linkState = new Uint8Array(3);
|
||||
|
||||
public dimensions: IRenderDimensions;
|
||||
|
||||
@@ -412,7 +413,6 @@ export class DomRenderer extends Disposable implements IRenderer {
|
||||
return `.${TERMINAL_CLASS_PREFIX}${this._terminalClass}`;
|
||||
}
|
||||
|
||||
private _linkState = new Uint8Array(3);
|
||||
private _handleLinkHover(e: ILinkifierEvent): void {
|
||||
this._setCellUnderline(e.x1, e.x2, e.y1, e.y2, e.cols, true);
|
||||
}
|
||||
|
||||
@@ -61,10 +61,6 @@ export class DomRendererRowFactory {
|
||||
metrics: Uint8Array,
|
||||
linkState: Uint8Array
|
||||
): DocumentFragment {
|
||||
// NOTE: `cellMap` maps cell positions to a span element index in a row.
|
||||
// All positions should be updated, even skipped ones after wide chars or left overs at the end,
|
||||
// otherwise the mouse hover logic might mark the wrong elements as underlined.
|
||||
|
||||
const fragment = this._document.createDocumentFragment();
|
||||
|
||||
const joinedRanges = this._characterJoinerService.getJoinedCharacters(row);
|
||||
@@ -130,9 +126,6 @@ export class DomRendererRowFactory {
|
||||
width = cell.getWidth();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const isInSelection = this._isCellInSelection(x, row);
|
||||
const isCursorCell = isCursorRow && x === cursorX;
|
||||
const cc = cell.getCode();
|
||||
@@ -149,6 +142,7 @@ export class DomRendererRowFactory {
|
||||
* - fg/bg/ul did not change
|
||||
* - char not part of a selection
|
||||
* - char is not cursor
|
||||
* - underline from hover state did not change
|
||||
*/
|
||||
if (
|
||||
cellAmount && width === 1 && !isCombined
|
||||
@@ -184,9 +178,6 @@ export class DomRendererRowFactory {
|
||||
oldExt = cell.extended.ext;
|
||||
oldLinkHover = isLinkHover;
|
||||
|
||||
|
||||
|
||||
|
||||
if (width > 1) {
|
||||
charElement.style.width = `${cellWidth * width}px`;
|
||||
}
|
||||
@@ -271,6 +262,7 @@ export class DomRendererRowFactory {
|
||||
charElement.classList.add(STRIKETHROUGH_CLASS);
|
||||
}
|
||||
|
||||
// apply link hover underline late, effectively overrides any previous text-decoration settings
|
||||
if (isLinkHover) {
|
||||
charElement.style.textDecoration = 'underline';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user