mirror of
https://github.com/ankitects/anki.git
synced 2025-12-16 08:10:59 -05:00
fix double-click to select
This commit is contained in:
parent
0946a3e0c4
commit
0b7c8bcecc
1 changed files with 2 additions and 3 deletions
|
|
@ -999,7 +999,7 @@ class FactEdit(QTextEdit):
|
||||||
if (not "japanese" in t and
|
if (not "japanese" in t and
|
||||||
not "mandarin" in t and
|
not "mandarin" in t and
|
||||||
not "cantonese" in t):
|
not "cantonese" in t):
|
||||||
return
|
return QTextEdit.mouseDoubleClickEvent(self,evt)
|
||||||
r = QRegExp("\\{(.*[|,].*)\\}")
|
r = QRegExp("\\{(.*[|,].*)\\}")
|
||||||
r.setMinimal(True)
|
r.setMinimal(True)
|
||||||
|
|
||||||
|
|
@ -1030,8 +1030,7 @@ class FactEdit(QTextEdit):
|
||||||
result = r.indexIn(self.toPlainText(), blockoffset)
|
result = r.indexIn(self.toPlainText(), blockoffset)
|
||||||
|
|
||||||
if found == "":
|
if found == "":
|
||||||
QTextEdit.mouseDoubleClickEvent(self,evt)
|
return QTextEdit.mouseDoubleClickEvent(self,evt)
|
||||||
return
|
|
||||||
self.setPlainText(self.toPlainText().replace(result, r.matchedLength(), found))
|
self.setPlainText(self.toPlainText().replace(result, r.matchedLength(), found))
|
||||||
|
|
||||||
def focusInEvent(self, evt):
|
def focusInEvent(self, evt):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue