Handle key compression when checking if ';' has been typed

This commit is contained in:
Kovid Goyal 2014-01-01 08:01:16 +05:30
parent 9442cbf38d
commit c911dfc40e

View File

@ -545,7 +545,7 @@ class TextEdit(QPlainTextEdit):
def keyPressEvent(self, ev): def keyPressEvent(self, ev):
QPlainTextEdit.keyPressEvent(self, ev) QPlainTextEdit.keyPressEvent(self, ev)
if (ev.key() == Qt.Key_Semicolon or unicode(ev.text()) == ';') and tprefs['replace_entities_as_typed'] and self.syntax == 'html': if (ev.key() == Qt.Key_Semicolon or ';' in unicode(ev.text())) and tprefs['replace_entities_as_typed'] and self.syntax == 'html':
self.replace_possible_entity() self.replace_possible_entity()
def replace_possible_entity(self): def replace_possible_entity(self):