editor: handle first line modification in before handler.

This should catch more use cases to mark the first line as modified.