]> granicus.if.org Git - python/commitdiff
#16887: IDLE now accepts Cancel in tabify/untabify dialog box.
authorRoger Serwy <roger.serwy@gmail.com>
Sun, 7 Apr 2013 01:26:53 +0000 (20:26 -0500)
committerRoger Serwy <roger.serwy@gmail.com>
Sun, 7 Apr 2013 01:26:53 +0000 (20:26 -0500)
Lib/idlelib/EditorWindow.py
Misc/NEWS

index 3397415205071d18ce8f21f5b4cc2ae15057a4ff..810f5885585c4f8babf07f43d617ff326818bc1f 100644 (file)
@@ -1433,6 +1433,7 @@ class EditorWindow(object):
     def tabify_region_event(self, event):
         head, tail, chars, lines = self.get_region()
         tabwidth = self._asktabwidth()
+        if tabwidth is None: return
         for pos in range(len(lines)):
             line = lines[pos]
             if line:
@@ -1444,6 +1445,7 @@ class EditorWindow(object):
     def untabify_region_event(self, event):
         head, tail, chars, lines = self.get_region()
         tabwidth = self._asktabwidth()
+        if tabwidth is None: return
         for pos in range(len(lines)):
             lines[pos] = lines[pos].expandtabs(tabwidth)
         self.set_region(head, tail, chars, lines)
@@ -1537,7 +1539,7 @@ class EditorWindow(object):
             parent=self.text,
             initialvalue=self.indentwidth,
             minvalue=2,
-            maxvalue=16) or self.tabwidth
+            maxvalue=16)
 
     # Guess indentwidth from text content.
     # Return guessed indentwidth.  This should not be believed unless
index 902298fee7ea3745a43b55acf72f444911e208b7..18a78344e74bb17ce8f97c30efed7cb402065c02 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -33,6 +33,8 @@ Library
 IDLE
 ----
 
+- Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
+
 - Issue #17625: In IDLE, close the replace dialog after it is used.
 
 - Issue #14254: IDLE now handles readline correctly across shell restarts.