Searching through files can now loop back to first file again

This commit is contained in:
Veronica K. B. Olsen
2020-06-17 19:29:25 +02:00
parent ad21c6e3a4
commit 32052b1bc3
2 changed files with 16 additions and 8 deletions
+5 -3
View File
@@ -1168,15 +1168,17 @@ class GuiDocEditor(QTextEdit):
searchFor = self.docSearch.getSearchText()
wasFound = self.find(searchFor, findOpt)
if not wasFound:
if self.docSearch.doLoop:
if self.docSearch.doNextFile and not isBackward:
self.theParent.openNextDocument(
self.theHandle, wrapAround=self.docSearch.doLoop
)
elif self.docSearch.doLoop:
theCursor = self.textCursor()
theCursor.movePosition(
QTextCursor.End if isBackward else QTextCursor.Start
)
self.setTextCursor(theCursor)
self.find(searchFor, findOpt)
elif self.docSearch.doNextFile:
self.theParent.openNextDocument(self.theHandle)
return