Edit book: Fix option-; not working in the editor. Fixes #1823040 [Mac Option-<key> shortcuts don't work in editor](https://bugs.launchpad.net/calibre/+bug/1823040)

This commit is contained in:
Kovid Goyal 2019-04-04 10:56:23 +05:30
parent a43207d38a
commit 79c21b14bc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -606,7 +606,10 @@ class Smarts(NullSmarts):
key = ev.key()
is_xml = editor.syntax == 'xml'
if tprefs['replace_entities_as_typed'] and (key == Qt.Key_Semicolon or ';' in ev_text):
if tprefs['replace_entities_as_typed'] and (
';' in ev_text or
(key == Qt.Key_Semicolon and no_modifiers(ev, Qt.ControlModifier, Qt.AltModifier))
):
self.replace_possible_entity(editor)
return True