Fix double and triple click on links in terminal

Fixes #41415
This commit is contained in:
Daniel Imms 2018-01-31 17:59:51 -08:00
parent 2690be77a4
commit c094367d26
4 changed files with 14 additions and 4 deletions

View file

@ -46,7 +46,7 @@
"vscode-debugprotocol": "1.25.0",
"vscode-ripgrep": "^0.7.1-patch.0",
"vscode-textmate": "^3.2.0",
"vscode-xterm": "3.1.0-beta14",
"vscode-xterm": "3.1.0-beta15",
"yauzl": "2.8.0"
},
"devDependencies": {

View file

@ -197,6 +197,14 @@ declare module 'vscode-xterm' {
* default value is 0.
*/
priority?: number;
/**
* A callback that fires when the mousedown and click events occur that
* determines whether a link will be activated upon click. This enables
* only activating a link when a certain modifier is held down, if not the
* mouse event will continue propagation (eg. double click to select word).
*/
willLinkActivate?: (event: MouseEvent, uri: string) => boolean;
}
export interface IEventEmitter {

View file

@ -93,6 +93,7 @@ export class TerminalLinkHandler {
validationCallback: (uri: string, callback: (isValid: boolean) => void) => validationCallback(uri, callback),
tooltipCallback: (e: MouseEvent, u) => this._widgetManager.showMessage(e.offsetX, e.offsetY, this._getLinkHoverString()),
leaveCallback: () => this._widgetManager.closeMessage(),
willLinkActivate: (e: MouseEvent) => this._isLinkActivationModifierDown(e),
priority: CUSTOM_LINK_PRIORITY
});
}
@ -106,6 +107,7 @@ export class TerminalLinkHandler {
validationCallback: (uri: string, callback: (isValid: boolean) => void) => this._validateLocalLink(uri, callback),
tooltipCallback: (e: MouseEvent, u) => this._widgetManager.showMessage(e.offsetX, e.offsetY, this._getLinkHoverString()),
leaveCallback: () => this._widgetManager.closeMessage(),
willLinkActivate: (e: MouseEvent) => this._isLinkActivationModifierDown(e),
priority: LOCAL_LINK_PRIORITY
});
}

View file

@ -6003,9 +6003,9 @@ vscode-textmate@^3.2.0:
fast-plist "^0.1.2"
oniguruma "^6.0.1"
vscode-xterm@3.1.0-beta14:
version "3.1.0-beta14"
resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.1.0-beta14.tgz#fe7baf16f9e695285d240fe281f74595388c23d8"
vscode-xterm@3.1.0-beta15:
version "3.1.0-beta15"
resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.1.0-beta15.tgz#d0b5353fb1fd574ccd023c67c71957b9b0f158c5"
vso-node-api@^6.1.2-preview:
version "6.1.2-preview"