Example #1
0
File: concat.py Project: tj90241/vx
 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
Example #2
0
 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
Example #3
0
File: concat.py Project: tj90241/vx
 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
Example #4
0
 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
Example #5
0
File: buffer.py Project: tj90241/vx
 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()
Example #6
0
 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()
Example #7
0
File: concat.py Project: tj90241/vx
 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
Example #8
0
 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
Example #9
0
File: vigor.py Project: tj90241/vx
def bol_insert():
    '''Move to beginning of line and enter insert mode'''
    # FIXME should move to first non-whitespace character
    move.bol()
    insert()