]> granicus.if.org Git - python/commitdiff
In Shell:
authorKurt B. Kaiser <kbk@shore.net>
Mon, 16 Dec 2002 22:25:10 +0000 (22:25 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Mon, 16 Dec 2002 22:25:10 +0000 (22:25 +0000)
1. If a tab is entered at the prompt, allow it to be backspaced away.
2. Eliminate the beep when hitting <enter> at the prompt.

Lib/idlelib/EditorWindow.py

index a1a48305967abc8efc781821395738acc3f06367..4bd766d2fc2e1b70843cfe5ea64079ee989fa081 100644 (file)
@@ -954,6 +954,8 @@ class EditorWindow:
         want = ((have - 1) // self.indentwidth) * self.indentwidth
         ncharsdeleted = 0
         while 1:
+            if chars == sys.ps1:
+                break
             chars = chars[:-1]
             ncharsdeleted = ncharsdeleted + 1
             have = len(chars.expandtabs(tabwidth))
@@ -1009,6 +1011,8 @@ class EditorWindow:
                 text.mark_set("insert", first)
             line = text.get("insert linestart", "insert")
             i, n = 0, len(line)
+            if line == sys.ps1:
+                return "break"
             while i < n and line[i] in " \t":
                 i = i+1
             if i == n: