fix: plain text search skips a quoted section after a match - #1160
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
allStringIndexto reflect non-CSV behavior and cover the reported regression case. - Add plain-text search
FindAllcoverage 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.
Owner
|
Thank you very much. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
=inmsg="a=b" level=info, with the search highlight shown as^[[7m:The
=inside the quotes is missed because the match at index 3 is followed by", andallStringIndexthen jumps past the whole quoted field.That quote skipping is a CSV delimiter rule. It was already split out into
allDelimiterIndexin 9db128a, and this removes the leftover copy fromallStringIndex, whose only remaining callers are the two searchFindAllmethods insearch.go. Column separation is unaffected.One existing expectation changes:
Test_allStringIndex/testDoubleQuotegoes 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 inTest_allDelimiterIndex/testDoubleQuote, unchanged.Full suite passes,
gofmtandgo vetclean.AI-assisted: written with Claude Code, reviewed and tested by me before sending.