示例#1
0
文件: concat.py 项目: 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
示例#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
示例#3
0
文件: concat.py 项目: 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
示例#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
示例#5
0
文件: buffer.py 项目: 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()
示例#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()
示例#7
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
示例#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
示例#9
0
文件: vigor.py 项目: 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()