Edit Book: Allow putting the editor into replace mode by pressing the Insert key

This commit is contained in:
Kovid Goyal 2014-05-10 19:05:26 +05:30
parent f337a57435
commit e4024b8b05

View File

@ -660,6 +660,10 @@ class TextEdit(PlainTextEdit):
if self.replace_possible_unicode_sequence():
ev.accept()
return
if ev.key() == Qt.Key_Insert:
self.setOverwriteMode(self.overwriteMode() ^ True)
ev.accept()
return
QPlainTextEdit.keyPressEvent(self, ev)
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()