]> granicus.if.org Git - python/commitdiff
Assume that the user knows when he wants to end the line; don't insert
authorKurt B. Kaiser <kbk@shore.net>
Thu, 4 Oct 2007 01:49:54 +0000 (01:49 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Thu, 4 Oct 2007 01:49:54 +0000 (01:49 +0000)
something he didn't select or complete.

Lib/idlelib/AutoComplete.py
Lib/idlelib/AutoCompleteWindow.py

index 7085386621fada5c3c97e20341c0973ee3be88d6..e1549be8387d910154eb9eacaab4a3393f558db0 100644 (file)
@@ -27,7 +27,7 @@ class AutoComplete:
 
     menudefs = [
         ('edit', [
-            ("Show completions", "<<force-open-completions>>"),
+            ("Show Completions", "<<force-open-completions>>"),
         ])
     ]
 
index dfe5f30d6e65753ea5bec86424306d9345f0e8c0..f7bd42311ba51699e6eb198831f94dd3eaf8ddab 100644 (file)
@@ -283,20 +283,9 @@ class AutoCompleteWindow:
             self._selection_changed()
             return "break"
 
-        elif keysym == "Return" and not state:
-            # If start is a prefix of the selection, or there was an indication
-            # that the user used the completion window, put the selected
-            # completion in the text, and close the list.
-            # Otherwise, close the window and let the event through.
-            cursel = int(self.listbox.curselection()[0])
-            if self.completions[cursel][:len(self.start)] == self.start or \
-               self.userwantswindow:
-                self._change_start(self.completions[cursel])
-                self.hide_window()
-                return "break"
-            else:
-                self.hide_window()
-                return
+        elif keysym == "Return":
+            self.hide_window()
+            return
 
         elif (self.mode == AutoComplete.COMPLETE_ATTRIBUTES and keysym in
               ("period", "space", "parenleft", "parenright", "bracketleft",