mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
handle -> activate
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user