def grab(self, buffer): with buffer.cursor_wander(): la, ca = buffer.cursor for _ in range(self.how_many): move.down(buffer) if self.forward else move.up(buffer) lb, cb = buffer.cursor return la, ca, lb, cb
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()