summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2012-06-03 10:00:48 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2012-06-03 10:00:48 (GMT)
commit156989aa7974a08364f96ad1dbe8a22bf2b41306 (patch)
tree1c37645714191683c613cc82c4d178d9af31efea /Lib/idlelib
parentfe4dfd2b65850f0cddec700e2f747fec611b4be9 (diff)
parent862d13a30f36d01404cec5c0553c66c89c8c8f2a (diff)
downloadcpython-156989aa7974a08364f96ad1dbe8a22bf2b41306.zip
cpython-156989aa7974a08364f96ad1dbe8a22bf2b41306.tar.gz
cpython-156989aa7974a08364f96ad1dbe8a22bf2b41306.tar.bz2
Merge 3.2: issue #14937.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/AutoComplete.py11
-rw-r--r--Lib/idlelib/AutoCompleteWindow.py9
-rw-r--r--Lib/idlelib/NEWS.txt5
3 files changed, 22 insertions, 3 deletions
diff --git a/Lib/idlelib/AutoComplete.py b/Lib/idlelib/AutoComplete.py
index 4e17325..1298d9f 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):
diff --git a/Lib/idlelib/AutoCompleteWindow.py b/Lib/idlelib/AutoCompleteWindow.py
index 1ad8d15..0477746 100644
--- a/Lib/idlelib/AutoCompleteWindow.py
+++ b/Lib/idlelib/AutoCompleteWindow.py
@@ -354,6 +354,15 @@ class AutoCompleteWindow:
# A modifier key, so ignore
return
+ elif event.char:
+ # Regular character with a non-length-1 keycode
+ self._change_start(self.start + event.char)
+ self.lasttypedstart = self.start
+ self.listbox.select_clear(0, int(self.listbox.curselection()[0]))
+ self.listbox.select_set(self._binary_search(self.start))
+ self._selection_changed()
+ return "break"
+
else:
# Unknown event, close the window and let it through.
self.hide_window()
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index b28e58a..7ea53db 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -1,6 +1,9 @@
-What's New in IDLE 3.3?
+What's New in IDLE 3.3.0?
=========================
+- Issue #14937: Perform auto-completion of filenames in strings even for
+ non-ASCII filenames.
+
- Issue #8515: Set __file__ when run file in IDLE.
Initial patch by Bruce Frederiksen.