From: Martin v. Löwis Date: Tue, 25 Jul 2006 09:53:12 +0000 (+0000) Subject: Bug #1525817: Don't truncate short lines in IDLE's tool tips. X-Git-Tag: v2.5b3~172 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b48303f28fa4846c713240c57501d5fa70436c7;p=thirdparty%2FPython%2Fcpython.git Bug #1525817: Don't truncate short lines in IDLE's tool tips. --- diff --git a/Lib/idlelib/CallTipWindow.py b/Lib/idlelib/CallTipWindow.py index afd4439a7df2..22238855c16a 100644 --- a/Lib/idlelib/CallTipWindow.py +++ b/Lib/idlelib/CallTipWindow.py @@ -49,7 +49,11 @@ class CallTip: """ # truncate overly long calltip if len(text) >= 79: - text = text[:75] + ' ...' + textlines = text.splitlines() + for i, line in enumerate(textlines): + if len(line) > 79: + textlines[i] = line[:75] + ' ...' + text = '\n'.join(textlines) self.text = text if self.tipwindow or not self.text: return diff --git a/Misc/NEWS b/Misc/NEWS index 9cbc9e48736c..afa7915b5710 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -39,6 +39,8 @@ Core and builtins Library ------- +- Bug #1525817: Don't truncate short lines in IDLE's tool tips. + - Patch #1515343: Fix printing of deprecated string exceptions with a value in the traceback module.