Skip to content

Commit 8a9f0be

Browse files
committed
Fixes issue w/ Safari & regex lookbehind
1 parent 3454fad commit 8a9f0be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/terminal/linkProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import type { GitTag } from '../git/models/tag';
1515
const commandsRegexShared =
1616
/\b(g(?:it)?\b\s*)\b(branch|checkout|cherry-pick|fetch|grep|log|merge|pull|push|rebase|reset|revert|show|stash|status|tag)\b/gi;
1717
// Since negative lookbehind isn't supported in all browsers, leave out the negative lookbehind condition `(?<!\.lock)` to ensure the branch name doesn't end with `.lock`
18-
const refRegexShared = /\b((?!\/)(?!\S*\/\/)(?!\S*@\{)(?!@$)(?!\S*\\)[^\000-\037\177 ~^:?*[]+(?<!\/)(?<!\.))\b/gi;
18+
const refRegexShared = /\b((?!.*\/\.)(?!.*\.\.)(?!.*\/\/)(?!.*@\{)[^\000-\037\177 ~^:?*[\\]+[^./])\b/gi;
1919
const rangeRegex = /^[0-9a-f]{7,40}\.\.\.?[0-9a-f]{7,40}$/;
2020
const shaRegex = /^[0-9a-f]{7,40}$/;
2121

@@ -54,6 +54,7 @@ export class GitTerminalLinkProvider implements Disposable, TerminalLinkProvider
5454

5555
let match;
5656
do {
57+
console.log(context.line);
5758
match = commandsRegex.exec(context.line);
5859
if (match != null) {
5960
const [_, git, command] = match;

0 commit comments

Comments
 (0)