diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index e459b1b1..d65c89df 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -376,9 +376,14 @@ class GuiDocEditor(QTextEdit): return False docText = self.getText() + + cC, wC, pC = countWords(docText) + self._updateCounts(cC, wC, pC) + theItem.setCharCount(self.charCount) theItem.setWordCount(self.wordCount) theItem.setParaCount(self.paraCount) + self.saveCursorPosition() self.nwDocument.saveDocument(docText) self.setDocumentChanged(False) diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index 03dc2ff8..9f4bb5e6 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -260,7 +260,8 @@ class GuiProjectTree(QTreeWidget): # Add the new item to the tree if tHandle is not None: self.revealNewTreeItem(tHandle, nHandle) - self.theParent.editItem(tHandle) + if self.mainConf.showGUI: + self.theParent.editItem(tHandle) return True