From 9c9ff2b38c6e8f3f0b4693f11527a08339414789 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 7 Aug 2022 07:46:16 -0700 Subject: [PATCH] Clean up --- src/browser/OscLinkProvider.ts | 9 ++------- src/common/InputHandler.ts | 3 --- src/common/buffer/AttributeData.ts | 7 ------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/browser/OscLinkProvider.ts b/src/browser/OscLinkProvider.ts index 8d3977c63..38c071068 100644 --- a/src/browser/OscLinkProvider.ts +++ b/src/browser/OscLinkProvider.ts @@ -16,11 +16,6 @@ export class OscLinkProvider implements ILinkProvider { } public provideLinks(y: number, callback: (links: ILink[] | undefined) => void): void { - // OSC links only work when a link handler is set - // if (this._optionsService.rawOptions.linkHandler === null) { - // return; - // } - const line = this._bufferService.buffer.lines.get(y - 1); if (!line) { callback(undefined); @@ -28,6 +23,7 @@ export class OscLinkProvider implements ILinkProvider { } const result: ILink[] = []; + const linkHandler = this._optionsService.rawOptions.linkHandler; const cell = new CellData(); const lineLength = line.getTrimmedLength(); let currentLinkId = -1; @@ -58,7 +54,6 @@ export class OscLinkProvider implements ILinkProvider { if (finishLink || (currentStart !== -1 && x === lineLength - 1)) { const text = this._oscLinkService.getLinkData(currentLinkId)?.uri; if (text) { - const linkHandler = this._optionsService.rawOptions.linkHandler; // OSC links always use underline and pointer decorations result.push({ text, @@ -91,8 +86,8 @@ export class OscLinkProvider implements ILinkProvider { } } } + // TODO: Handle fetching and returning other link ranges to underline other links with the same id - console.log('result', result); callback(result); } } diff --git a/src/common/InputHandler.ts b/src/common/InputHandler.ts index 37a0a1274..34c99f844 100644 --- a/src/common/InputHandler.ts +++ b/src/common/InputHandler.ts @@ -2912,7 +2912,6 @@ export class InputHandler extends Disposable implements IInputHandler { */ public setHyperlink(data: string): boolean { const args = data.split(';'); - console.log('hyperlink', args); if (args.length < 2) { return false; } @@ -2939,13 +2938,11 @@ export class InputHandler extends Disposable implements IInputHandler { this._curAttrData.extended = this._curAttrData.extended.clone(); this._currentLinkId = this._oscLinkService.registerLink({ id, uri }); this._curAttrData.extended.urlId = this._currentLinkId; - console.log('register', uri, `id=${this._curAttrData.extended.urlId}`); this._curAttrData.updateExtended(); return true; } private _finishHyperlink(): boolean { - console.log('finish hyperlink'); this._curAttrData.extended = this._curAttrData.extended.clone(); this._curAttrData.extended.urlId = 0; this._curAttrData.updateExtended(); diff --git a/src/common/buffer/AttributeData.ts b/src/common/buffer/AttributeData.ts index aac6a33dc..3af3d2939 100644 --- a/src/common/buffer/AttributeData.ts +++ b/src/common/buffer/AttributeData.ts @@ -134,9 +134,7 @@ export class AttributeData implements IAttributeData { export class ExtendedAttrs implements IExtendedAttrs { private _ext: number = 0; public get ext(): number { - // TODO: How to handle previous underline style if link overrides it? if (this._urlId) { - console.log('ext, has url'); return ( (this._ext & ~ExtFlags.UNDERLINE_STYLE) | (this.underlineStyle << 26) @@ -159,11 +157,6 @@ export class ExtendedAttrs implements IExtendedAttrs { } public get underlineColor(): number { - // Always return the URL color if it has one - if (this._urlId) { - // TODO: fix - return 0; - } return this._ext & (Attributes.CM_MASK | Attributes.RGB_MASK); } public set underlineColor(value: number) {