src/documentmanager.cpp

changeset 334
083b0d8e220a
parent 333
07e65a4c6611
child 335
c5830bce1c23
--- 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());

mercurial