Previously, any edit would mark the file as dirty even if the content was restored to its original state. Now we compare against the original content and clear the dirty flag when they match.