diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-17 14:12:24 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-17 14:12:24 +0300 |
| commit | b2cb4ca0563cc73af20460fe3b319263a96a6989 (patch) | |
| tree | 0ab024e8983edcd8d25174b6da7749be15c8f9a9 /internal/server/handlers/readcommand.go | |
| parent | 069dff93d8c6c8f0ba28d9f6123fa9b1430c2f92 (diff) | |
Fix grep context lines bug in channelless implementation
- 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>
Diffstat (limited to 'internal/server/handlers/readcommand.go')
0 files changed, 0 insertions, 0 deletions
