]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Bug #1525817: Don't truncate short lines in IDLE's tool tips.
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 25 Jul 2006 09:53:12 +0000 (09:53 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 25 Jul 2006 09:53:12 +0000 (09:53 +0000)
Lib/idlelib/CallTipWindow.py
Misc/NEWS

index afd4439a7df26b1e4e8d17189b97ad1ed3bf2054..22238855c16ade9120fd2317b9f17fc8ad8530c9 100644 (file)
@@ -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
index 9cbc9e48736cbdfc0dd7fcc19e252d08f92771f2..afa7915b5710afbd3d7913add7b86d0722ca195a 100644 (file)
--- 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.