Skip to content

Commit

Permalink
Merge pull request #1519 from chrjorgensen/fix/searches
Browse files Browse the repository at this point in the history
Fix minor search errors
  • Loading branch information
sebjulliand authored Sep 4, 2023
2 parents 08700fa + a14277b commit 4e2ef8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export namespace Search {

const grepRes = await connection.sendCommand({
command: `${grep} -inr -F -f - ${ignoreString} ${Tools.escapePath(path)}`,
stdin: sanitizeSearchTerm(searchTerm)
stdin: searchTerm
});

if (grepRes.code == 0) {
Expand Down Expand Up @@ -120,7 +120,7 @@ export namespace Search {
}

function sanitizeSearchTerm(searchTerm: string): string {
return searchTerm.replace(/\\/g, `\\\\`).replace(/"/g, `\\\\"`);
return searchTerm.replace(/\\/g, `\\\\`).replace(/"/g, `\\"`);
}

function nthIndex(aString: string, pattern: string, n: number) {
Expand Down

0 comments on commit 4e2ef8c

Please sign in to comment.