def insert_char(self, c):
"""Given an integer character, insert that character in the current
line. Stop when the maximum line length is reached.
"""
if c not in string.printable:
return
para_idx, line_idx, char_idx = self.paragraph
line = list(self.line)
line.insert(char_idx, c)
char_idx += 1
self.line = "".join(line)
self._char_index_to_yx(para_idx, char_idx)
评论列表
文章目录