Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
Open
Description
In#136061,
Lines 1365 to 1385 in561212a
# Ick. It may require *inserting* spaces if we back up over a | |
# tab character! This is written to be clear, not fast. | |
tabwidth=self.tabwidth | |
have=len(chars.expandtabs(tabwidth)) | |
asserthave>0 | |
want= ((have-1)//self.indentwidth)*self.indentwidth | |
# Debug prompt is multilined.... | |
ncharsdeleted=0 | |
whileTrue: | |
chars=chars[:-1] | |
ncharsdeleted=ncharsdeleted+1 | |
have=len(chars.expandtabs(tabwidth)) | |
ifhave<=wantorchars[-1]notin"\t": | |
break | |
text.undo_block_start() | |
text.delete("insert-%dc"%ncharsdeleted,"insert") | |
ifhave<want: | |
text.insert("insert",' '* (want-have), | |
self.user_input_insert_tags) | |
text.undo_block_stop() | |
return"break" |
However, the complexity there comes from a loop which handles situations (files with tabs) that either cannot or should not occur; in the current default IDLE, you can't put tabs, and a space after a tab should just be deleted in a file coming from elsewhere as in indicated in#134874 (comment). Therefore, simplifying the function specification and/or deprecating IDLE to handle tabs (which we should do) will allow elimination of this piece of obsolete code, as indicated in#136061 (comment).
Metadata
Metadata
Assignees
Projects
Status
No status