Thu, 14 Jul 2022 16:47:59 +0300
Convert text model to CR+LF when saving
src/documentmanager.cpp | file | annotate | diff | comparison | revisions |
--- a/src/documentmanager.cpp Mon Jul 04 19:53:13 2022 +0300 +++ b/src/documentmanager.cpp Thu Jul 14 16:47:59 2022 +0300 @@ -195,7 +195,7 @@ QSaveFile file{info->path}; file.setDirectWriteFallback(true); if (file.open(QSaveFile::WriteOnly)) { - file.write(info->model->toPlainText().toUtf8()); + file.write(info->model->toPlainText().replace("\n", "\r\n").toUtf8()); const bool commitSucceeded = file.commit(); if (not commitSucceeded) { errors << QObject::tr("Could not save: %1").arg(file.errorString());