Skip to content

Commit

Permalink
fix a bug sed rules may not override keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Dec 23, 2023
1 parent 35e645f commit aa0bdc7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions background/open_urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ export const openUrlWithActions = (url: Urls.Url, workType: Urls.WorkType, sed?:

}

const openCopiedUrl = (copied: KnownOptions<C.openUrl>["copied"]
const openCopiedUrl = (copied: KnownOptions<C.openUrl>["copied"], exOut: InfoOnSed
, tabs: [Tab] | [] | undefined, url: string | null): void => {
if (url === null) {
complainLimits(trans_("readClipboard"))
Expand All @@ -620,6 +620,7 @@ const openCopiedUrl = (copied: KnownOptions<C.openUrl>["copied"]
runNextCmd<C.openUrl>(0)
return
}
exOut.keyword_ != null && overrideCmdOptions<C.openUrl>({ keyword: exOut.keyword_ })
const searchLines = typeof copied === "string" && copied.includes("any")
let urls: string[]
if ((copied === "urls" || searchLines) && (urls = url.split(<RegExpG> /[\r\n]+/g)).length > 1) {
Expand Down Expand Up @@ -731,11 +732,10 @@ export const openUrl = (tabs?: [Tab] | []): void => {
} else {
url = paste_(parseSedOptions_(get_cOptions<C.openUrl, true>()), 0, exOut)
}
exOut.keyword_ != null && overrideCmdOptions<C.openUrl>({ keyword: exOut.keyword_ })
if (url instanceof Promise) {
void url.then(/*#__NOINLINE__*/ openCopiedUrl.bind(null, copied, tabs))
void url.then(/*#__NOINLINE__*/ openCopiedUrl.bind(null, copied, exOut, tabs))
} else {
openCopiedUrl(copied, tabs, url)
openCopiedUrl(copied, exOut, tabs, url)
}
} else if (rawUrl || get_cOptions<C.openUrl>().sed) {
openUrlWithActions(rawUrl != null ? rawUrl as AllowToString + "" : "", Urls.WorkType.EvenAffectStatus, true, tabs)
Expand Down

0 comments on commit aa0bdc7

Please sign in to comment.