@@ -15,12 +15,10 @@ import * as ssh from 'ssh2'
15
15
const { changeprompt, changemodule, fullpath } =
16
16
client . import ( { msg : [ 'changeprompt' , 'changemodule' , 'resetprompt' ] , rpc : [ 'validatepath' , 'fullpath' ] } )
17
17
18
- let uriRegex
19
- if ( process . platform === 'win32' ) {
20
- uriRegex = / ( @ ( [ ^ \s ] + ) \s ( .* ?) \: ( \d + ) | ( ( ( [ a - z A - Z ] : | \. \. ? | \~ ) | ( [ ^ \0 < > \? \| \/ \s ! $ ` & * ( ) \[ \] + ' " : ; ] ) + ) ? ( ( \\ | \/ ) ( [ ^ \0 < > \? \| \/ \s ! $ ` & * ( ) \[ \] + ' " : ; ] ) + ) + ) ( \: \d + ) ? ) /
21
- } else {
22
- uriRegex = / ( @ ( [ ^ \s ] + ) \s ( .* ?) \: ( \d + ) | ( ( ( \. \. ? | \~ ) | ( [ ^ \0 \s ! $ ` & * ( ) \[ \] + ' " : ; \\ ] ) + ) ? ( \/ ( [ ^ \0 \s ! $ ` & * ( ) \[ \] + ' " : ; \\ ] ) + ) + ) ( \: \d + ) ? ) /
23
- }
18
+ const isWindows = process . platform === 'win32'
19
+ const uriRegex = isWindows ?
20
+ / ( @ ( [ ^ \s ] + ) \s ( .* ?) \: ( \d + ) | ( ( ( [ a - z A - Z ] : | \. \. ? | \~ ) | ( [ ^ \0 < > \? \| \/ \s ! $ ` & * ( ) \[ \] + ' " : ; ] ) + ) ? ( ( \\ | \/ ) ( [ ^ \0 < > \? \| \/ \s ! $ ` & * ( ) \[ \] + ' " : ; ] ) + ) + ) ( \: \d + ) ? ) / :
21
+ / ( @ ( [ ^ \s ] + ) \s ( .* ?) \: ( \d + ) | ( ( ( \. \. ? | \~ ) | ( [ ^ \0 \s ! $ ` & * ( ) \[ \] + ' " : ; \\ ] ) + ) ? ( \/ ( [ ^ \0 \s ! $ ` & * ( ) \[ \] + ' " : ; \\ ] ) + ) + ) ( \: \d + ) ? ) /
24
22
25
23
var whitelistedKeybindingsREPL = [ ]
26
24
var whitelistedKeybindingsTerminal = [ ]
@@ -264,7 +262,10 @@ function handleLink (event, uri) {
264
262
pending : atom . config . get ( 'core.allowPendingPaneItems' )
265
263
} )
266
264
} else {
267
- urimatch = uri . match ( / ( [ ^ \: ] + ) (?: \: ( \d + ) ) ? / )
265
+ const matchregex = isWindows ?
266
+ / ( ( [ a - z A - Z ] \: ) ? [ ^ \: ] + ) (?: \: ( \d + ) ) ? / :
267
+ / ( [ ^ \: ] + ) (?: \: ( \d + ) ) ? /
268
+ urimatch = uri . match ( matchregex )
268
269
if ( urimatch ) {
269
270
const line = urimatch [ 2 ] !== null ? parseInt ( urimatch [ 2 ] ) : 0
270
271
ink . Opener . open ( urimatch [ 1 ] , line - 1 , {
@@ -287,7 +288,7 @@ let tooltip = null
287
288
288
289
function showTooltip ( event , uri , location , terminal ) {
289
290
if ( atom . config . get ( 'julia-client.consoleOptions.linkModifier' ) ) {
290
- let el = document . createElement ( 'div' )
291
+ const el = document . createElement ( 'div' )
291
292
el . classList . add ( 'terminal-link-tooltip' )
292
293
293
294
const terminalRect = terminal . element . getBoundingClientRect ( )
0 commit comments