diff -r 097554712637 Lib/idlelib/OutputWindow.py --- a/Lib/idlelib/OutputWindow.py Wed Apr 03 00:42:24 2013 -0500 +++ b/Lib/idlelib/OutputWindow.py Wed Apr 03 19:41:03 2013 -0500 @@ -43,7 +43,28 @@ except UnicodeError: # some other encoding; let Tcl deal with it pass - self.text.insert(mark, s, tags) + + # manual line wrapping + wrap_index = 80 + lines = s.split('\n') + + # starting column + col = int(self.text.index(mark).split('.')[1]) + + # characters remaining before wrap + remaining = wrap_index - col + + wrap = [] + for line in lines: + line_wrap = [] + i = 0 + while i < len(line): + line_wrap.append(line[i:i+remaining]) + i += wrap_index + remaining = wrap_index + wrap.append('\n'.join(line_wrap)) + self.text.insert(mark, '\n'.join(wrap), tags) + self.text.see(mark) self.text.update()