Fix #242.  Handle case where newlines are introduced as the result of a
search/replace.