Clean up
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user