equal
deleted
inserted
replaced
717 # Maximum width for this line. |
717 # Maximum width for this line. |
718 width = self.width - len(indent) |
718 width = self.width - len(indent) |
719 |
719 |
720 # First chunk on line is whitespace -- drop it, unless this |
720 # First chunk on line is whitespace -- drop it, unless this |
721 # is the very beginning of the text (i.e. no lines started yet). |
721 # is the very beginning of the text (i.e. no lines started yet). |
722 if self.drop_whitespace and chunks[-1].strip() == r'' and lines: |
722 if self.drop_whitespace and chunks[-1].strip() == '' and lines: |
723 del chunks[-1] |
723 del chunks[-1] |
724 |
724 |
725 while chunks: |
725 while chunks: |
726 l = colwidth(chunks[-1]) |
726 l = colwidth(chunks[-1]) |
727 |
727 |
748 del cur_line[-1] |
748 del cur_line[-1] |
749 |
749 |
750 # Convert current line back to a string and store it in list |
750 # Convert current line back to a string and store it in list |
751 # of all lines (return value). |
751 # of all lines (return value). |
752 if cur_line: |
752 if cur_line: |
753 lines.append(indent + r''.join(cur_line)) |
753 lines.append(indent + ''.join(cur_line)) |
754 |
754 |
755 return lines |
755 return lines |
756 |
756 |
757 global _MBTextWrapper |
757 global _MBTextWrapper |
758 _MBTextWrapper = tw |
758 _MBTextWrapper = tw |