예제 #1
0
파일: concat.py 프로젝트: tj90241/vx
 def grab(self, buffer):
     with buffer.cursor_wander():
         la, ca = buffer.cursor
         for _ in range(self.how_many):
             offset = text.get_offset_regex(buffer, r'^$', forwards=self.forward)
             if offset is None:
                 move.end(buffer) if self.forward else move.end(buffer)
             else:
                 utils.repeat(move.right if self.forward else move.left, times=offset)
             lb, cb = buffer.cursor
         return la, ca, lb, cb
예제 #2
0
 def grab(self, buffer):
     with buffer.cursor_wander():
         la, ca = buffer.cursor
         for _ in range(self.how_many):
             offset = text.get_offset_regex(buffer, r'^$', forwards=self.forward)
             if offset is None:
                 move.end(buffer) if self.forward else move.end(buffer)
             else:
                 utils.repeat(move.right if self.forward else move.left, times=offset)
             lb, cb = buffer.cursor
         return la, ca, lb, cb
예제 #3
0
파일: concat.py 프로젝트: 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
예제 #4
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