From 2dc225ae1f9e553e31dd78762fb721cc245863e7 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Sun, 26 Jul 2020 22:21:35 +0200 Subject: [PATCH] Revert that ... --- nw/gui/doceditor.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/nw/gui/doceditor.py b/nw/gui/doceditor.py index 7a6a9837..d961ad8c 100644 --- a/nw/gui/doceditor.py +++ b/nw/gui/doceditor.py @@ -1237,10 +1237,18 @@ class GuiDocEditor(QTextEdit): replWith = self.docSearch.getReplaceText() selText = theCursor.selectedText() - if searchFor: - if self.docSearch.doMatchCap: - replWith = transferCase(selText, replWith) + if self.docSearch.doMatchCap: + replWith = transferCase(selText, replWith) + if self.docSearch.isRegEx: + isMatch = True + else: + if not self.docSearch.isCaseSense: + isMatch = searchFor.lower() == selText.lower() + else: + isMatch = searchFor == selText + + if isMatch: theCursor.beginEditBlock() theCursor.removeSelectedText() theCursor.insertText(replWith) @@ -1251,6 +1259,7 @@ class GuiDocEditor(QTextEdit): searchFor, replWith, theCursor.blockNumber() )) + if searchFor: self._findNext() return