def delete(self, track=True): if track: self.dirty = True l, c = self.cursor move.right() lb, cb = self.cursor move.left() ch = vx.get_ch_linecol_window(self, l, c) self.undo_tree.add(removal(ch, l, c, hold=True, box=(l, c, lb, cb))) super(buffer, self).delete()
def delete(self, track=True): if track: self.dirty = True l, c = self.cursor move.right() lb, cb = self.cursor move.left() ch = vx.get_ch_linecol_window(self, l, c) self.undo_tree.add(removal(ch, l, c, hold=True, box=(l, c, lb, cb))) super().delete()
def backspace(self, track=True): if track: self.dirty = True l, c = self.cursor lb, cb = l, c if l > 1 or c > 1: c = c - 1 if c == 0: l -= 1 move.up() move.eol() _, c = self.cursor move.down() move.bol() ch = vx.get_ch_linecol_window(self, l, c) if ch == '\t': c -= 7 self.undo_tree.add(removal(ch, l, c, hold=False, box=(l, c, lb, cb))) super(buffer, self).backspace()
def backspace(self, track=True): if track: self.dirty = True l, c = self.cursor lb, cb = l, c if l > 1 or c > 1: c = c - 1 if c == 0: l -= 1 move.up() move.eol() _, c = self.cursor move.down() move.bol() ch = vx.get_ch_linecol_window(self, l, c) if ch == '\t': c -= 7 self.undo_tree.add( removal(ch, l, c, hold=False, box=(l, c, lb, cb))) super().backspace()