def grab(self, buffer): with buffer.cursor_wander(): la, ca, lb, cb = super(beginning_lines, self).grab(buffer) buffer.cursor = (lb, cb) move.bol() lb, cb = buffer.cursor return la, ca, lb, cb
def grab(self, buffer): with buffer.cursor_wander(): la, ca, lb, cb = super().grab(buffer) buffer.cursor = (lb, cb) move.bol() lb, cb = buffer.cursor return la, ca, lb, cb
def grab(self, buffer): with buffer.cursor_wander(): move.bol() if self.forward else move.eol() la, ca, lb, cb = super(whole_lines, self).grab(buffer) buffer.cursor = (lb, cb) move.eol() if self.forward else move.bol() lb, cb = buffer.cursor return la, ca, lb, cb
def grab(self, buffer): with buffer.cursor_wander(): move.bol() if self.forward else move.eol() la, ca, lb, cb = super().grab(buffer) buffer.cursor = (lb, cb) move.eol() if self.forward else move.bol() 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()
def grab(self, buffer): with buffer.cursor_wander(): la, ca = buffer.cursor breaks = (' ', '\n') for _ in range(self.how_many): offset = text.get_offset_regex(buffer, '[{}]'.format(''.join(breaks)), forwards=self.forward) if offset is None: move.eol(buffer) if self.forward else move.bol(buffer) else: utils.repeat(move.right if self.forward else move.left, times=offset) lb, cb = buffer.cursor return la, ca, lb, cb
def bol_insert(): '''Move to beginning of line and enter insert mode''' # FIXME should move to first non-whitespace character move.bol() insert()