From ad50ef6e8ca385e30ba4b9237ecda4c709d13c9c Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 24 Sep 2020 23:24:15 +0200 Subject: [PATCH] Fix bug in document section stats --- nw/core/index.py | 2 +- tests/test_gui.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nw/core/index.py b/nw/core/index.py index 84c02a1f..b32fd0c4 100644 --- a/nw/core/index.py +++ b/nw/core/index.py @@ -356,7 +356,7 @@ class NWIndex(): # Count words for remaining text after last heading if nTitle > 0: - lastText = "\n".join(theLines[nTitle-1:nLine-1]) + lastText = "\n".join(theLines[nTitle-1:]) self._indexWordCounts(tHandle, isNovel, lastText, nTitle) # Update timestamps for index changes diff --git a/tests/test_gui.py b/tests/test_gui.py index fd1f426d..53bce03a 100644 --- a/tests/test_gui.py +++ b/tests/test_gui.py @@ -1074,9 +1074,9 @@ def testOutline(qtbot, nwLipsum, nwTemp): assert nwGUI.projMeta.fileValue.text() == "Lorem Ipsum" assert nwGUI.projMeta.itemValue.text() == "Finished" - assert nwGUI.projMeta.cCValue.text() == "122" - assert nwGUI.projMeta.wCValue.text() == "18" - assert nwGUI.projMeta.pCValue.text() == "2" + assert nwGUI.projMeta.cCValue.text() == "230" + assert nwGUI.projMeta.wCValue.text() == "40" + assert nwGUI.projMeta.pCValue.text() == "3" # Scene One actItem = nwGUI.projView.topLevelItem(1)