-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
The e after, e before, and e replace commands only match single-line patterns. Real-world code patterns frequently span multiple lines:
// Can't match this with `e after`
type WindowSizeMsg struct {
Width int
Height int
}In our evaluation, both agents (Runs C and D) independently identified this as the main reason they preferred the built-in Edit tool over e for code modifications. When e after failed on a multi-line pattern, they had to fall back to e append with a line number, which is fragile (line numbers shift after edits).
Proposal
Support multi-line patterns in content-addressed commands:
# Match a multi-line block
e after file.go $'Height int\n}' 'new content'
# Or with --stdin for complex patterns
echo 'type WindowSizeMsg struct {
Width int
Height int
}' | e --stdin replace file.go - 'replacement'Design options
- Newline literals in patterns — interpret
\nin pattern strings - Multi-line stdin patterns — use
--stdinto read the match pattern too (needs a separator or second flag) - Heredoc-style —
e after file.go <<'MATCH' <<'TEXT'
Option 1 is simplest and covers most cases. Option 2 handles arbitrary content.
Impact
Without this, e cannot compete with the built-in Edit tool for real-world code changes. The Edit tool's exact-string-match approach handles multi-line blocks naturally and was unanimously preferred by the evaluation agents.