def delete_backward_char(self): if not self.text or self.cursor <= 0: return self.text = util.rmstr(self.text, self.cursor - 1) self.cursor -= 1 del self.textmap[self.cursor] self.edithook()
def delete_char(self): if not self.text: self.hide() try: self.text = util.rmstr(self.text, self.cursor) del self.textmap[self.cursor] self.edithook() except IndexError: pass