Procházet zdrojové kódy

Fixes issue w/ Safari & regex lookbehind

main
Eric Amodio před 2 roky
rodič
revize
8a9f0bed38
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. +2
    -1
      src/terminal/linkProvider.ts

+ 2
- 1
src/terminal/linkProvider.ts Zobrazit soubor

@ -15,7 +15,7 @@ import type { GitTag } from '../git/models/tag';
const commandsRegexShared =
/\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;
// 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`
const refRegexShared = /\b((?!\/)(?!\S*\/\/)(?!\S*@\{)(?!@$)(?!\S*\\)[^\000-\037\177 ~^:?*[]+(?<!\/)(?<!\.))\b/gi;
const refRegexShared = /\b((?!.*\/\.)(?!.*\.\.)(?!.*\/\/)(?!.*@\{)[^\000-\037\177 ~^:?*[\\]+[^./])\b/gi;
const rangeRegex = /^[0-9a-f]{7,40}\.\.\.?[0-9a-f]{7,40}$/;
const shaRegex = /^[0-9a-f]{7,40}$/;
@ -54,6 +54,7 @@ export class GitTerminalLinkProvider implements Disposable, TerminalLinkProvider
let match;
do {
console.log(context.line);
match = commandsRegex.exec(context.line);
if (match != null) {
const [_, git, command] = match;

Načítá se…
Zrušit
Uložit