Esempio n. 1
0
File: buffer.py Progetto: tj90241/vx
 def delete(self, track=True):
     if track:
         self.dirty = True
         l, c = self.cursor
         move.right()
         lb, cb = self.cursor
         move.left()
         ch = vx.get_ch_linecol_window(self, l, c)
         self.undo_tree.add(removal(ch, l, c, hold=True, box=(l, c, lb, cb)))
     super(buffer, self).delete()
Esempio n. 2
0
 def delete(self, track=True):
     if track:
         self.dirty = True
         l, c = self.cursor
         move.right()
         lb, cb = self.cursor
         move.left()
         ch = vx.get_ch_linecol_window(self, l, c)
         self.undo_tree.add(removal(ch, l, c, hold=True,
                                    box=(l, c, lb, cb)))
     super().delete()
Esempio n. 3
0
File: buffer.py Progetto: 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()
Esempio n. 4
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()