]> granicus.if.org Git - python/commitdiff
bpo-15786: Fix IDLE autocomplete return problem. (#2198)
authorterryjreedy <tjreedy@udel.edu>
Wed, 14 Jun 2017 19:43:15 +0000 (15:43 -0400)
committerGitHub <noreply@github.com>
Wed, 14 Jun 2017 19:43:15 +0000 (15:43 -0400)
Before, <return> would not, for instance, complete 're.c' to 're.compile' even with 'compile' highlighted.  Now it does.  Before, <return> was inserted into text, which in Shell meant compile() and possibly execute.  Now cursor is left after completion.

Lib/idlelib/autocomplete_w.py

index e7354d0b95ba5a8157c959d87b663c39cd9c0933..7c3138f4040a307d4cb59f01b6938a31365600ac 100644 (file)
@@ -325,8 +325,9 @@ class AutoCompleteWindow:
             return "break"
 
         elif keysym == "Return":
+            self.complete()
             self.hide_window()
-            return None
+            return 'break'
 
         elif (self.mode == COMPLETE_ATTRIBUTES and keysym in
               ("period", "space", "parenleft", "parenright", "bracketleft",