Skip to content

Commit

Permalink
Fix double and triple click on links in terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Feb 1, 2018
1 parent 2690be7 commit c094367
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 8 additions & 0 deletions src/typings/vscode-xterm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}
Expand All @@ -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
});
}
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c094367

Please sign in to comment.