From 79c21b14bc68fa949417b7a2f6875de2ff3b2de9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 4 Apr 2019 10:56:23 +0530 Subject: [PATCH] Edit book: Fix option-; not working in the editor. Fixes #1823040 [Mac Option- shortcuts don't work in editor](https://bugs.launchpad.net/calibre/+bug/1823040) --- src/calibre/gui2/tweak_book/editor/smarts/html.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/editor/smarts/html.py b/src/calibre/gui2/tweak_book/editor/smarts/html.py index bd27141c5f..73c0bbc1e7 100644 --- a/src/calibre/gui2/tweak_book/editor/smarts/html.py +++ b/src/calibre/gui2/tweak_book/editor/smarts/html.py @@ -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