Some minor code tweaks
This commit is contained in:
+5
-6
@@ -1262,20 +1262,19 @@ class GuiDocEditor(QTextEdit):
|
|||||||
|
|
||||||
searchFor = self.docSearch.getSearchText()
|
searchFor = self.docSearch.getSearchText()
|
||||||
replWith = self.docSearch.getReplaceText()
|
replWith = self.docSearch.getReplaceText()
|
||||||
selText = theCursor.selectedText()
|
|
||||||
|
|
||||||
if self.docSearch.doMatchCap:
|
if self.docSearch.doMatchCap:
|
||||||
replWith = transferCase(selText, replWith)
|
replWith = transferCase(theCursor.selectedText(), replWith)
|
||||||
|
|
||||||
# Make sure the selected text was selected by an actual find
|
# Make sure the selected text was selected by an actual find
|
||||||
# call, and not the user.
|
# call, and not the user.
|
||||||
try:
|
try:
|
||||||
isResult = self.lastFind[0] == theCursor.selectionStart()
|
isFind = self.lastFind[0] == theCursor.selectionStart()
|
||||||
isResult &= self.lastFind[1] == theCursor.selectionEnd()
|
isFind &= self.lastFind[1] == theCursor.selectionEnd()
|
||||||
except:
|
except:
|
||||||
isResult = False
|
isFind = False
|
||||||
|
|
||||||
if isResult:
|
if isFind:
|
||||||
theCursor.beginEditBlock()
|
theCursor.beginEditBlock()
|
||||||
theCursor.removeSelectedText()
|
theCursor.removeSelectedText()
|
||||||
theCursor.insertText(replWith)
|
theCursor.insertText(replWith)
|
||||||
|
|||||||
Reference in New Issue
Block a user