Mercurial > jwe > octave
comparison libgui/src/m-editor/file-editor-tab.cc @ 31081:7ea420f2c722 stable
fix file length when saving a shorter contents in editor (bug #62588)
* file-editor-tab.cc (do_save_file): resize the file to current position
after writing
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Mon, 06 Jun 2022 19:17:05 +0200 |
parents | 2b4f7287aa3a |
children | f0343b3685df |
comparison
equal
deleted
inserted
replaced
31079:2c8ab613e805 | 31081:7ea420f2c722 |
---|---|
2246 && m_edit_area->text ().length ()) | 2246 && m_edit_area->text ().length ()) |
2247 out << m_edit_area->eol_string (); // Add newline if desired | 2247 out << m_edit_area->eol_string (); // Add newline if desired |
2248 | 2248 |
2249 out.flush (); | 2249 out.flush (); |
2250 QApplication::restoreOverrideCursor (); | 2250 QApplication::restoreOverrideCursor (); |
2251 file.resize (file.pos()); | |
2251 file.flush (); | 2252 file.flush (); |
2252 file.close (); | 2253 file.close (); |
2253 | 2254 |
2254 // file exists now | 2255 // file exists now |
2255 QFileInfo file_info = QFileInfo (file); | 2256 QFileInfo file_info = QFileInfo (file); |