Keep scroll position when pressing Ctrl+R on the same document

This commit is contained in:
Veronica K. B. Olsen
2019-06-09 16:49:42 +02:00
parent ac0acac935
commit db700d4e8b
+3
View File
@@ -124,12 +124,15 @@ class GuiDocViewer(QTextBrowser):
return False
logger.debug("Generating preview for item %s" % tHandle)
sPos = self.verticalScrollBar().value()
aDoc = ToHtml(self.theProject, self.theParent)
aDoc.setText(tHandle)
aDoc.doAutoReplace()
aDoc.tokenizeText()
aDoc.doConvert()
self.setHtml(aDoc.theResult)
if self.theHandle == tHandle:
self.verticalScrollBar().setValue(sPos)
self.theHandle = tHandle
self.theProject.setLastViewed(tHandle)