handle -> activate

This commit is contained in:
Daniel Imms
2020-02-07 09:59:25 -08:00
parent b18ded0e2d
commit f4a31251cb
4 changed files with 5 additions and 5 deletions
@@ -21,7 +21,7 @@ export class WebLinkProvider implements ILinkProvider {
}
export class LinkComputer {
public static computeLink(position: IBufferCellPosition, regex: RegExp, terminal: Terminal, handle: (event: MouseEvent, uri: string) => void): ILink | undefined {
public static computeLink(position: IBufferCellPosition, regex: RegExp, terminal: Terminal, handler: (event: MouseEvent, uri: string) => void): ILink | undefined {
const rex = new RegExp(regex.source, (regex.flags || '') + 'g');
const [line, startLineIndex] = LinkComputer._translateBufferLineToStringWithWrap(position.y - 1, false, terminal);
@@ -68,7 +68,7 @@ export class LinkComputer {
}
};
return { range, text, handle };
return { range, text, activate: handler };
}
}
+1 -1
View File
@@ -136,7 +136,7 @@ export class Linkifier2 implements ILinkifier2 {
}
if (this._linkAtPosition(this._currentLink, position)) {
this._currentLink.handle(event, this._currentLink.text);
this._currentLink.activate(event, this._currentLink.text);
}
}
+1 -1
View File
@@ -172,7 +172,7 @@ interface ILinkProvider {
interface ILink {
range: IBufferRange;
text: string;
handle(event: MouseEvent, text: string): void;
activate(event: MouseEvent, text: string): void;
hover?(event: MouseEvent, text: string): void;
leave?(event: MouseEvent, text: string): void;
}
+1 -1
View File
@@ -1113,7 +1113,7 @@ declare module 'xterm' {
* @param event The mouse event triggering the callback.
* @param text The text of the link.
*/
handle(event: MouseEvent, text: string): void;
activate(event: MouseEvent, text: string): void;
/**
* Called when the mouse hovers the link.