use what was added in #637 to replace first title lookup in editor saveText
This commit is contained in:
+11
-6
@@ -416,17 +416,22 @@ class GuiDocEditor(QTextEdit):
|
|||||||
|
|
||||||
self.theIndex.scanText(tHandle, docText)
|
self.theIndex.scanText(tHandle, docText)
|
||||||
|
|
||||||
hLevel, _ = self.theParent.theIndex.getFirstTitle(tHandle)
|
if self._updateHeaders(checkLevel=True):
|
||||||
|
if self.theParent.projTabs.currentIndex() == self.theParent.idxNovelView:
|
||||||
|
logger.verbose("Document headers have changed, updating novel tree")
|
||||||
|
self.theParent.novelView.refreshTree()
|
||||||
|
else:
|
||||||
|
self.theParent.novelView.updateWordCounts(tHandle)
|
||||||
|
|
||||||
|
hLevel = "H0"
|
||||||
|
if self.theHeaders:
|
||||||
|
hLevel = self.theHeaders[0][1]
|
||||||
|
|
||||||
if self.theProject.projTree.updateItemLayout(tHandle, hLevel):
|
if self.theProject.projTree.updateItemLayout(tHandle, hLevel):
|
||||||
self.theParent.treeView.setTreeItemValues(tHandle)
|
self.theParent.treeView.setTreeItemValues(tHandle)
|
||||||
self.nwDocument.saveDocument(docText)
|
self.nwDocument.saveDocument(docText)
|
||||||
self.docFooter.updateInfo()
|
self.docFooter.updateInfo()
|
||||||
|
|
||||||
if self._updateHeaders(checkLevel=True):
|
|
||||||
self.theParent.novelView.refreshTree()
|
|
||||||
else:
|
|
||||||
self.theParent.novelView.updateWordCounts(tHandle)
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def updateDocMargins(self):
|
def updateDocMargins(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user