Skip to content

fix(search): find whole-word matches past the per-file substring cap - #168

Merged
PPRAMANIK62 merged 3 commits into
liliu-z:mainfrom
DevMello:fix/whole-word-per-file-cap
Aug 14, 2026
Merged

fix(search): find whole-word matches past the per-file substring cap#168
PPRAMANIK62 merged 3 commits into
liliu-z:mainfrom
DevMello:fix/whole-word-per-file-cap

Conversation

@DevMello

Copy link
Copy Markdown

Summary

Keyword search with whole_word could return nothing while a real match sat in
the file. --max-count caps ripgrep's unfiltered hits, but whole-token filtering
runs app-side, so a file whose first 50 hits are all substring-only loses every
real match below that point and still reports no truncation.

What changed

  • Pass --max-count only on the substring path, where the whole-token filter is
    a no-op.
  • Apply the per-file cap after filtering when whole_word is set, like
    searchDerivedMarkdown already does. Non-whole-word searches are unchanged.

Validation

  • pnpm typecheck
  • Focused tests for the affected behavior
  • Renderer build or E2E coverage, when the change affects the UI

Two new cases in server/keyword-search.test.ts, red before and green after.

UI and visual baselines

  • This PR changes a rendered UI surface or visual state.
  • This fork PR allows maintainer edits if a reviewed Linux visual baseline update is needed.
  • This PR does not change a visual surface, or existing visual baselines remain valid.

Documentation

  • Updated the relevant design-docs/ and code-review/ contract, when this changes documented behavior or invariants.
  • No documentation update is needed.

DevMello and others added 3 commits August 13, 2026 14:55
`--max-count` caps ripgrep's unfiltered hits, but whole-token filtering
runs app-side, so a file whose first 50 hits are all substring-only
loses every real match below that point and reports no truncation.
@PPRAMANIK62
PPRAMANIK62 merged commit 246025f into liliu-z:main Aug 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants