Simplify and reproduce GEdit more accurately.