diff --git a/nw/core/project.py b/nw/core/project.py index 0d43229c..c981e4c8 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -1121,8 +1121,10 @@ class NWProject(): with open(sessionFile, mode="a+", encoding="utf8") as outFile: if not isFile: # It's a new file, so add a header - outFile.write("# Initial: %d\n# %-17s %-19s %8s %8s\n" % ( - self.lastWCount, "Start Time", "End Time", "Novel", "Notes" + if self.lastWCount > 0: + outFile.write("# Offset %d\n" % self.lastWCount) + outFile.write("# %-17s %-19s %8s %8s\n" % ( + "Start Time", "End Time", "Novel", "Notes" )) outFile.write("%-19s %-19s %8d %8d\n" % ( diff --git a/nw/gui/sessionlog.py b/nw/gui/sessionlog.py index 9c66e923..cab4a92c 100644 --- a/nw/gui/sessionlog.py +++ b/nw/gui/sessionlog.py @@ -401,8 +401,8 @@ class GuiSessionLog(QDialog): with open(logFile, mode="r", encoding="utf8") as inFile: for inLine in inFile: if inLine.startswith("#"): - if inLine.startswith("# Initial:"): - self.wordOffset = int(inLine[11:].strip()) + if inLine.startswith("# Offset"): + self.wordOffset = int(inLine[9:].strip()) logger.verbose( "Initial word count when log was started is %d" % self.wordOffset ) diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index 8f8ee49c..ecdc1d0c 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,13 +1,13 @@ - + Sample Project Sample Project Jane Smith Jay Doh - 583 + 587 102 - 24189 + 24235 False