From ee5cdc1d413a49f94a4471390a83a2526d458e4e Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sat, 30 May 2020 13:17:21 +0200 Subject: [PATCH] Consitent end of file line endings for merge and split tools --- nw/gui/dialogs/docmerge.py | 2 +- nw/gui/dialogs/docsplit.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nw/gui/dialogs/docmerge.py b/nw/gui/dialogs/docmerge.py index 39c7d0bf..1fc225a9 100644 --- a/nw/gui/dialogs/docmerge.py +++ b/nw/gui/dialogs/docmerge.py @@ -106,7 +106,7 @@ class GuiDocMerge(QDialog): theDoc = NWDoc(self.theProject, self.theParent) theText = "" for tHandle in finalOrder: - theText += theDoc.openDocument(tHandle, False).rstrip() + theText += theDoc.openDocument(tHandle, False).rstrip("\n") theText += "\n\n" if self.sourceItem is None: diff --git a/nw/gui/dialogs/docsplit.py b/nw/gui/dialogs/docsplit.py index f95e0041..e029a49b 100644 --- a/nw/gui/dialogs/docsplit.py +++ b/nw/gui/dialogs/docsplit.py @@ -182,6 +182,7 @@ class GuiDocSplit(QDialog): ) theText = "\n".join(theLines[iStart:iEnd]) + theText = theText.rstrip("\n") + "\n\n" theDoc.openDocument(nHandle, False) theDoc.saveDocument(theText) theDoc.clearDocument()