Try to capture some user edge cases
This commit is contained in:
+9
-8
@@ -1237,16 +1237,18 @@ class GuiDocEditor(QTextEdit):
|
|||||||
replWith = self.docSearch.getReplaceText()
|
replWith = self.docSearch.getReplaceText()
|
||||||
selText = theCursor.selectedText()
|
selText = theCursor.selectedText()
|
||||||
|
|
||||||
|
if searchFor.strip() == "":
|
||||||
|
return
|
||||||
|
|
||||||
if self.docSearch.doMatchCap:
|
if self.docSearch.doMatchCap:
|
||||||
replWith = transferCase(selText, replWith)
|
replWith = transferCase(selText, replWith)
|
||||||
|
|
||||||
if self.docSearch.isRegEx:
|
# Double check that we have a mach in case this is called on a
|
||||||
isMatch = True
|
# plain word selection and not on a search
|
||||||
|
if not self.docSearch.isCaseSense:
|
||||||
|
isMatch = searchFor.lower() == selText.lower()
|
||||||
else:
|
else:
|
||||||
if not self.docSearch.isCaseSense:
|
isMatch = searchFor == selText
|
||||||
isMatch = searchFor.lower() == selText.lower()
|
|
||||||
else:
|
|
||||||
isMatch = searchFor == selText
|
|
||||||
|
|
||||||
if isMatch:
|
if isMatch:
|
||||||
theCursor.beginEditBlock()
|
theCursor.beginEditBlock()
|
||||||
@@ -1259,8 +1261,7 @@ class GuiDocEditor(QTextEdit):
|
|||||||
searchFor, replWith, theCursor.blockNumber()
|
searchFor, replWith, theCursor.blockNumber()
|
||||||
))
|
))
|
||||||
|
|
||||||
if searchFor:
|
self._findNext()
|
||||||
self._findNext()
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user