Better support for syntax auto-detection and stop adding a million newlines at the end of files