mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#16887: IDLE now accepts Cancel in tabify/untabify dialog box.
This commit is contained in:
parent
278d03bd66
commit
0ef392cde7
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue