Skip to content

fix: plain text search skips a quoted section after a match - #1160

Merged
noborus merged 1 commit into
noborus:masterfrom
VXNCXNX:fix/search-skips-quoted-section
Aug 19, 2026
Merged

fix: plain text search skips a quoted section after a match#1160
noborus merged 1 commit into
noborus:masterfrom
VXNCXNX:fix/search-skips-quoted-section

Conversation

@VXNCXNX

@VXNCXNX VXNCXNX commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

A plain text search skips over an entire double-quoted section whenever a match ends immediately before a ", so matches inside that section are never highlighted.

Searching = in msg="a=b" level=info, with the search highlight shown as ^[[7m:

before: msg^[[7m=^[[0m"a=b" level^[[7m=^[[0minfo
after:  msg^[[7m=^[[0m"a^[[7m=^[[0mb" level^[[7m=^[[0minfo

The = inside the quotes is missed because the match at index 3 is followed by ", and allStringIndex then jumps past the whole quoted field.

That quote skipping is a CSV delimiter rule. It was already split out into allDelimiterIndex in 9db128a, and this removes the leftover copy from allStringIndex, whose only remaining callers are the two search FindAll methods in search.go. Column separation is unaffected.

One existing expectation changes: Test_allStringIndex/testDoubleQuote goes from [[1 2] [7 8]] to [[1 2] [4 5] [7 8]]. That case was asserting CSV behaviour on the search function; the equivalent CSV assertion still lives in Test_allDelimiterIndex/testDoubleQuote, unchanged.

Full suite passes, gofmt and go vet clean.

AI-assisted: written with Claude Code, reviewed and tested by me before sending.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes plain-text search highlighting so that matches inside double-quoted sections are not skipped when a match occurs immediately before a " character. This aligns the plain-text search behavior with the intent that quotes are ordinary characters (CSV-style quote skipping remains confined to delimiter/column parsing).

Changes:

  • Remove CSV-style “skip quoted field” logic from allStringIndex, so it reports all occurrences (including inside quotes).
  • Update/add unit tests for allStringIndex to reflect non-CSV behavior and cover the reported regression case.
  • Add plain-text search FindAll coverage to ensure quoted sections don’t suppress subsequent matches.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
oviewer/utils.go Removes quote-skipping from allStringIndex and clarifies its plain-text search semantics.
oviewer/utils_test.go Updates expectations and adds regression tests for matches before/inside quoted sections.
oviewer/search_test.go Adds coverage ensuring plain-text search highlighting finds matches inside quoted sections.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@noborus

noborus commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Thank you very much.
I'll merge it.

@noborus
noborus merged commit 691b318 into noborus:master Aug 19, 2026
6 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.

3 participants