10000 bpo-15786: Fix IDLE autocomplete return problem. (#2198) · python/cpython@32fd874 · GitHub
[go: up one dir, main page]

Skip to content

Commit 32fd874

Browse files
authored
bpo-15786: Fix IDLE autocomplete return problem. (#2198)
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.
1 parent b18563d commit 32fd874

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/idlelib/autocomplete_w.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,9 @@ def keypress_event(self, event):
325325
return "break"
326326

327327
elif keysym == "Return":
328+
self.complete()
328329
self.hide_window()
329-
return None
330+
return 'break'
330331

331332
elif (self.mode == COMPLETE_ATTRIBUTES and keysym in
332333
("period", "space", "parenleft", "parenright", "bracketleft",

0 commit comments

Comments
 (0)
0