def status_delete(self, key): l = len(self.display.status) if l == 1: return if self.sx == (l - 1): self.status_backspace(key) else: delete_element(self.display.status, self.sx)
def delete_char_at_cursor(self, key): index = self.cursor.x l = len(self.current_line()) if l == 1: del self.lines[self.cursor.y] # self.cursor_down(key) elif index == (l - 1): self.delete_char_before_cursor(key) else: if (index % 4) == 0: if l > index + 4: line = self.current_line() for si in range(index, index + 4): if line[si].ch != u' ': break else: # Delete the four spaces for di in range(4): delete_element(self.lines[self.cursor.y], index) return delete_element(self.lines[self.cursor.y], index)