diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2012-06-03 12:00:48 +0200 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2012-06-03 12:00:48 +0200 |
commit | 156989aa7974a08364f96ad1dbe8a22bf2b41306 (patch) | |
tree | 1c37645714191683c613cc82c4d178d9af31efea /Lib/idlelib/AutoComplete.py | |
parent | fe4dfd2b65850f0cddec700e2f747fec611b4be9 (diff) | |
parent | 862d13a30f36d01404cec5c0553c66c89c8c8f2a (diff) | |
download | cpython-git-156989aa7974a08364f96ad1dbe8a22bf2b41306.tar.gz |
Merge 3.2: issue #14937.
Diffstat (limited to 'Lib/idlelib/AutoComplete.py')
-rw-r--r-- | Lib/idlelib/AutoComplete.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/AutoComplete.py index 4e173252d6..1298d9f012 100644 --- a/Lib/idlelib/AutoComplete.py +++ b/Lib/idlelib/AutoComplete.py @@ -124,13 +124,20 @@ 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. self._remove_autocomplete_window() mode = COMPLETE_FILES - while i and curline[i-1] in FILENAME_CHARS: + # Find last separator or string start + while i and curline[i-1] not in "'\"" + SEPS: i -= 1 comp_start = curline[i:j] j = i - while i and curline[i-1] in FILENAME_CHARS + SEPS: + # Find string start + while i and curline[i-1] not in "'\"": i -= 1 comp_what = curline[i:j] elif hp.is_in_code() and (not mode or mode==COMPLETE_ATTRIBUTES): |