WIP: First draft

This commit is contained in:
Bruno Ribeito
2019-03-06 21:45:53 +00:00
parent f41146fb40
commit 51e2cdfafb
+7
View File
@@ -36,6 +36,13 @@ function handleLink(event: MouseEvent, uri: string): void {
*/
export function webLinksInit(term: Terminal, handler: (event: MouseEvent, uri: string) => void = handleLink, options: ILinkMatcherOptions = {}): void {
options.matchIndex = 1;
handler = (event, uri) => {
if (!term.hasSelection()) {
window.open(uri, '_blank');
}
};
term.registerLinkMatcher(strictUrlRegex, handler, options);
}