# HG changeset patch # User Torsten Lilge # Date 1582870094 -3600 # Node ID 908bdd05398a714b0d70e9b23af2f82d701f8d94 # Parent 33d89d314d4332f7ec49501e75366cef5bba65e7 do not add a newline on empty editor files (bug #57861) * file-editor-tab.cc (do_save_file): also check file length before adding a newline while saving the file diff -r 33d89d314d43 -r 908bdd05398a libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Thu Feb 27 23:22:30 2020 +0100 +++ b/libgui/src/m-editor/file-editor-tab.cc Fri Feb 28 07:08:14 2020 +0100 @@ -2313,7 +2313,8 @@ QApplication::setOverrideCursor (Qt::WaitCursor); out << m_edit_area->text (); - if (settings->value (ed_force_newline).toBool ()) + if (settings->value (ed_force_newline).toBool () + && m_edit_area->text ().length ()) out << eol_string (); // Add newline if desired out.flush ();