mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Fix error when middle clicking in editor on systems w/o global mouse selection (#3923)
* fix potential error when middle clicking in editor * update about.py
This commit is contained in:
parent
e7fbf159a6
commit
1d2d6e51b9
2 changed files with 5 additions and 4 deletions
|
@ -219,6 +219,7 @@ def show(mw: aqt.AnkiQt) -> QDialog:
|
|||
"Brayan Oliveira",
|
||||
"Market345",
|
||||
"Yuki",
|
||||
"🦙 (siid)",
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -1497,8 +1497,8 @@ class EditorWebView(AnkiWebView):
|
|||
|
||||
def _get_clipboard_html_for_field(self, mode: QClipboard.Mode) -> str | None:
|
||||
clip = self._clipboard()
|
||||
mime = clip.mimeData(mode)
|
||||
assert mime is not None
|
||||
if not (mime := clip.mimeData(mode)):
|
||||
return None
|
||||
if not mime.hasHtml():
|
||||
return None
|
||||
return mime.html()
|
||||
|
@ -1540,9 +1540,9 @@ class EditorWebView(AnkiWebView):
|
|||
print("reuse internal")
|
||||
self.editor.doPaste(html, True, extended)
|
||||
else:
|
||||
if not (mime := clipboard.mimeData(mode=mode)):
|
||||
return
|
||||
print("use clipboard")
|
||||
mime = clipboard.mimeData(mode=mode)
|
||||
assert mime is not None
|
||||
html, internal = self._processMime(mime, extended)
|
||||
if html:
|
||||
self.editor.doPaste(html, internal, extended)
|
||||
|
|
Loading…
Reference in a new issue