summaryrefslogtreecommitdiff
path: root/Lib/idlelib/autocomplete.py
diff options
context:
space:
mode:
authorLouie Lu <git@louie.lu>2019-03-25 07:33:12 +0800
committerTerry Jan Reedy <tjreedy@udel.edu>2019-03-24 19:33:12 -0400
commit113d735e2091427f9623097d2a222dd99b16b568 (patch)
tree618029b078e0862ccabf403224c3380be29f2ad8 /Lib/idlelib/autocomplete.py
parent13c1f72cd1d91fdc2654f2f57356b2eacb75f164 (diff)
downloadcpython-git-113d735e2091427f9623097d2a222dd99b16b568.tar.gz
bpo-30348: IDLE: Add test_autocomplete unittest (GH-2209)
Diffstat (limited to 'Lib/idlelib/autocomplete.py')
-rw-r--r--Lib/idlelib/autocomplete.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/Lib/idlelib/autocomplete.py b/Lib/idlelib/autocomplete.py
index d57e9c9000..e20b757d87 100644
--- a/Lib/idlelib/autocomplete.py
+++ b/Lib/idlelib/autocomplete.py
@@ -104,9 +104,14 @@ class AutoComplete:
def open_completions(self, evalfuncs, complete, userWantsWin, mode=None):
"""Find the completions and create the AutoCompleteWindow.
Return True if successful (no syntax error or so found).
- if complete is True, then if there's nothing to complete and no
+ If complete is True, then if there's nothing to complete and no
start of completion, won't open completions and return False.
If mode is given, will open a completion list only in this mode.
+
+ Action Function Eval Complete WantWin Mode
+ ^space force_open_completions True, False, True no
+ . or / try_open_completions False, False, False yes
+ tab autocomplete False, True, True no
"""
# Cancel another delayed call, if it exists.
if self._delayed_completion_id is not None:
@@ -117,11 +122,11 @@ class AutoComplete:
curline = self.text.get("insert linestart", "insert")
i = j = len(curline)
if hp.is_in_string() and (not mode or mode==COMPLETE_FILES):
- # Find the beginning of the string
- # fetch_completions will look at the file system to determine whether the
- # string value constitutes an actual file name
- # XXX could consider raw strings here and unescape the string value if it's
- # not raw.
+ # Find the beginning of the string.
+ # fetch_completions will look at the file system to determine
+ # whether the string value constitutes an actual file name
+ # XXX could consider raw strings here and unescape the string
+ # value if it's not raw.
self._remove_autocomplete_window()
mode = COMPLETE_FILES
# Find last separator or string start