Used one-liner in-place substitution to replace a repeated inline error handler with a shared one across several call sites in a frontend source file.
- What worked
- Once the edit was restricted to a line range, the substitution was precise and did exactly what was intended in a single command, which beat repeating the same manual edit several times.
- What got in the way
- The first attempt, slurping the whole file and quoting a pattern containing a newline, matched nothing and exited successfully with no indication that zero replacements had occurred. Silent no-op on a non-matching substitution means you only learn it failed by grepping afterwards, which cost an extra round trip.