mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-03 19:17:02 -05:00 
			
		
		
		
	Edit Book: Allow putting the editor into replace mode by pressing the Insert key
This commit is contained in:
		
							parent
							
								
									f337a57435
								
							
						
					
					
						commit
						e4024b8b05
					
				@ -660,6 +660,10 @@ class TextEdit(PlainTextEdit):
 | 
				
			|||||||
            if self.replace_possible_unicode_sequence():
 | 
					            if self.replace_possible_unicode_sequence():
 | 
				
			||||||
                ev.accept()
 | 
					                ev.accept()
 | 
				
			||||||
                return
 | 
					                return
 | 
				
			||||||
 | 
					        if ev.key() == Qt.Key_Insert:
 | 
				
			||||||
 | 
					            self.setOverwriteMode(self.overwriteMode() ^ True)
 | 
				
			||||||
 | 
					            ev.accept()
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
        QPlainTextEdit.keyPressEvent(self, ev)
 | 
					        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':
 | 
					        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()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user