def insert_line(self, n=1):
"""
Inserts *n* lines at the current cursor position.
"""
#logging.debug("insert_line(%s)" % n)
if not n: # Takes care of an empty string
n = 1
n = int(n)
for i in xrange(n):
self.screen.pop(self.bottom_margin) # Remove the bottom line
# Remove bottom line's style information as well:
self.renditions.pop(self.bottom_margin)
empty_line = array('u', u' ' * self.cols) # Line full of spaces
self.screen.insert(self.cursorY, empty_line) # Insert at cursor
# Insert a new empty rendition as well:
empty_rend = array('u', unichr(1000) * self.cols)
self.renditions.insert(self.cursorY, empty_rend) # Insert at cursor
评论列表
文章目录