From 57910c4fa3c4df3e75a8b5ecdce24f7e299d68e5 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Fri, 30 Aug 2024 03:08:55 -0400 Subject: [PATCH] Minor fixes --- src/utils/ripgrep.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/ripgrep.ts b/src/utils/ripgrep.ts index f7756bf..3f31234 100644 --- a/src/utils/ripgrep.ts +++ b/src/utils/ripgrep.ts @@ -93,7 +93,7 @@ async function execRipgrep(bin: string, args: string[]): Promise { let output = "" let lineCount = 0 - const maxLines = MAX_RESULTS * 10 // limiting ripgrep output with max lines since there's no other way to limit results. it's okay that we're outputting as json, since we're parsing it line by line and ignore anything that's not part of a match. This assumes each result is at most 10 lines. + const maxLines = MAX_RESULTS * 5 // limiting ripgrep output with max lines since there's no other way to limit results. it's okay that we're outputting as json, since we're parsing it line by line and ignore anything that's not part of a match. This assumes each result is at most 5 lines. rl.on("line", (line) => { if (lineCount < maxLines) { @@ -187,9 +187,9 @@ function formatResults(results: SearchResult[], cwd: string): string { let output = "" if (results.length >= MAX_RESULTS) { - output += `Showing first ${MAX_RESULTS} of ${MAX_RESULTS}+ results. Use a more specific search if necessary...\n\n` + output += `Showing first ${MAX_RESULTS} of ${MAX_RESULTS}+ results. Use a more specific search if necessary.\n\n` } else { - output += `Found ${results.length.toLocaleString()} results...\n\n` + output += `Found ${results.length.toLocaleString()} results.\n\n` } // Group results by file name