Skip to content

Commit 61cd28f

Browse files
committed
Fix slowdown
1 parent 53765ff commit 61cd28f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/providers/FileSystemProvider/TextSearchProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ export class TextSearchProvider implements vscode.TextSearchProvider {
329329
// Filter out duplicates and compute all matches for each one
330330
[...new Set(lines)].forEach((line, _index, matchedLines) => {
331331
const text = content[line];
332-
const previewFrom = Math.max(line - options.beforeContext || 0, 0);
333-
const previewTo = Math.min(line + options.afterContext || 0, content.length - 1);
332+
const previewFrom = Math.max(line - (options.beforeContext || 0), 0);
333+
const previewTo = Math.min(line + (options.afterContext || 0), content.length - 1);
334334
const regex = new RegExp(
335335
query.isRegExp ? query.pattern : query.pattern.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"),
336336
query.isCaseSensitive ? "g" : "gi"

0 commit comments

Comments
 (0)