diff options
| author | Kurt B. Kaiser <kbk@shore.net> | 2008-02-14 04:19:41 (GMT) |
|---|---|---|
| committer | Kurt B. Kaiser <kbk@shore.net> | 2008-02-14 04:19:41 (GMT) |
| commit | 2fbad0e99bf581dc8e5e3afa8253765ebafd9493 (patch) | |
| tree | 2d9f260f4dc47249dd56e1ec385f86ee086049ae /Lib/idlelib/AutoCompleteWindow.py | |
| parent | 60d9f8df383cfc89bb1f927c06393cfcb12fe7d6 (diff) | |
| download | cpython-2fbad0e99bf581dc8e5e3afa8253765ebafd9493.zip cpython-2fbad0e99bf581dc8e5e3afa8253765ebafd9493.tar.gz cpython-2fbad0e99bf581dc8e5e3afa8253765ebafd9493.tar.bz2 | |
Assume that the user knows when he wants to end the line; don't insert
something he didn't select or complete.
Backport r58306
Diffstat (limited to 'Lib/idlelib/AutoCompleteWindow.py')
| -rw-r--r-- | Lib/idlelib/AutoCompleteWindow.py | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/Lib/idlelib/AutoCompleteWindow.py b/Lib/idlelib/AutoCompleteWindow.py index 9cdb830..be4150d 100644 --- a/Lib/idlelib/AutoCompleteWindow.py +++ b/Lib/idlelib/AutoCompleteWindow.py @@ -274,20 +274,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", |
