diff options
author | Roger Serwy <roger.serwy@gmail.com> | 2013-04-07 01:26:53 (GMT) |
---|---|---|
committer | Roger Serwy <roger.serwy@gmail.com> | 2013-04-07 01:26:53 (GMT) |
commit | 0ef392cde7e088fce776581dacdb459ac39b5e7b (patch) | |
tree | 23fcb8ed9ac9a8c088ab95a9b119354577ea7c76 /Lib | |
parent | 278d03bd66e40d57168ff66c6fb79eae599a784d (diff) | |
download | cpython-0ef392cde7e088fce776581dacdb459ac39b5e7b.zip cpython-0ef392cde7e088fce776581dacdb459ac39b5e7b.tar.gz cpython-0ef392cde7e088fce776581dacdb459ac39b5e7b.tar.bz2 |
#16887: IDLE now accepts Cancel in tabify/untabify dialog box.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 3397415..810f588 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -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 |