cpython: 41e85ac2ccef (original) (raw)
Mercurial > cpython
changeset 77322:41e85ac2ccef 3.2
Issue #14937: Perform auto-completion of filenames in strings even for non-ASCII filenames. [#14937]
Martin v. Löwis martin@v.loewis.de | |
---|---|
date | Sun, 03 Jun 2012 11:55:32 +0200 |
parents | f927a5c6e4be |
children | 9aa8af0761ef ec5bc858df25 |
files | Lib/idlelib/AutoComplete.py Lib/idlelib/AutoCompleteWindow.py Lib/idlelib/NEWS.txt |
diffstat | 3 files changed, 24 insertions(+), 2 deletions(-)[+] [-] Lib/idlelib/AutoComplete.py 11 Lib/idlelib/AutoCompleteWindow.py 9 Lib/idlelib/NEWS.txt 6 |
line wrap: on
line diff
--- 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[](#l1.7)
# fetch_completions will look at the file system to determine whether the[](#l1.8)
# string value constitutes an actual file name[](#l1.9)
# XXX could consider raw strings here and unescape the string value if it's[](#l1.10)
# not raw.[](#l1.11) self._remove_autocomplete_window()[](#l1.12) mode = COMPLETE_FILES[](#l1.13)
while i and curline[i-1] in FILENAME_CHARS:[](#l1.14)
# Find last separator or string start[](#l1.15)
while i and curline[i-1] not in "'\"" + SEPS:[](#l1.16) i -= 1[](#l1.17) comp_start = curline[i:j][](#l1.18) j = i[](#l1.19)
while i and curline[i-1] in FILENAME_CHARS + SEPS:[](#l1.20)
# Find string start[](#l1.21)
while i and curline[i-1] not in "'\"":[](#l1.22) i -= 1[](#l1.23) comp_what = curline[i:j][](#l1.24) elif hp.is_in_code() and (not mode or mode==COMPLETE_ATTRIBUTES):[](#l1.25)
--- 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:[](#l2.7)
# Regular character with a non-length-1 keycode[](#l2.8)
self._change_start(self.start + event.char)[](#l2.9)
self.lasttypedstart = self.start[](#l2.10)
self.listbox.select_clear(0, int(self.listbox.curselection()[0]))[](#l2.11)
self.listbox.select_set(self._binary_search(self.start))[](#l2.12)
self._selection_changed()[](#l2.13)
return "break"[](#l2.14)
+ else: # Unknown event, close the window and let it through. self.hide_window()
--- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -1,3 +1,9 @@ +What's New in IDLE 3.2.4? +========================= + +- Issue #14937: Perform auto-completion of filenames in strings even for