|
- Fixed critical bug where matching lines were incorrectly treated as after context
- After context logic now only applies to non-matching lines, not matches
- Consecutive matches no longer interfere with after context counting
- All grep context options now work correctly: --before, --after, --max
- TestDGrepContext1 and TestDGrepContext2 now pass with channelless implementation
- Full compatibility with original channel-based behavior maintained
- All integration tests passing
The bug was in GrepProcessor.ProcessLine() where any line with afterRemaining > 0
was treated as after context, including matching lines. Fixed by moving after
context logic inside the !isMatch condition block.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
|