summaryrefslogtreecommitdiff
path: root/Lib/idlelib/AutoCompleteWindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/AutoCompleteWindow.py')
-rw-r--r--Lib/idlelib/AutoCompleteWindow.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/Lib/idlelib/AutoCompleteWindow.py b/Lib/idlelib/AutoCompleteWindow.py
index 785979e797..ca9109bd54 100644
--- a/Lib/idlelib/AutoCompleteWindow.py
+++ b/Lib/idlelib/AutoCompleteWindow.py
@@ -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 == COMPLETE_ATTRIBUTES and keysym in
("period", "space", "parenleft", "parenright", "bracketleft",