@lvce-editor/text-search-worker 7.12.0 → 7.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1438,7 +1438,14 @@ const textSearch$6 = async (root, query, options, assetDir, platform, searchId,
1438
1438
  return results;
1439
1439
  };
1440
1440
 
1441
+ const getContextArgs = contextLines => {
1442
+ if (contextLines && contextLines > 0) {
1443
+ return ['--context', `${Math.trunc(contextLines)}`];
1444
+ }
1445
+ return [];
1446
+ };
1441
1447
  const getRipGrepArgs = ({
1448
+ contextLines,
1442
1449
  defaultExcludes,
1443
1450
  exclude,
1444
1451
  isCaseSensitive,
@@ -1448,7 +1455,7 @@ const getRipGrepArgs = ({
1448
1455
  useIgnoreFiles = true,
1449
1456
  useRegularExpression
1450
1457
  }) => {
1451
- const ripGrepArgs = ['--hidden', '--no-require-git', '--smart-case', '--stats', '--json', '--threads', `${threads}`];
1458
+ const ripGrepArgs = ['--hidden', '--no-require-git', '--smart-case', '--stats', '--json', '--threads', `${threads}`, ...getContextArgs(contextLines)];
1452
1459
  if (!useIgnoreFiles) {
1453
1460
  ripGrepArgs.push('--no-ignore');
1454
1461
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/text-search-worker",
3
- "version": "7.12.0",
3
+ "version": "7.13.1",
4
4
  "description": "Text Search Worker",
5
5
  "keywords": [
6
6
  "text-search"