Fix bug when the application adds the empty line to the end of the file after saving