diff -r ad51ed93377c Lib/idlelib/AutoComplete.py --- a/Lib/idlelib/AutoComplete.py Thu Oct 11 00:11:26 2012 -0700 +++ b/Lib/idlelib/AutoComplete.py Thu Oct 11 13:01:23 2012 -0500 @@ -137,6 +137,12 @@ while i and curline[i-1] not in "'\"": i -= 1 comp_what = curline[i:j] + if i == j == 0: + # Cursor is within a multiline string, don't display file completions. + return + if not comp_start.strip() and not comp_what.strip(): + # Blank comparisions - nothing to complete. + return elif hp.is_in_code() and (not mode or mode==COMPLETE_ATTRIBUTES): self._remove_autocomplete_window() mode = COMPLETE_ATTRIBUTES @@ -159,6 +165,11 @@ comp_lists = self.fetch_completions(comp_what, mode) if not comp_lists[0]: return + if mode == COMPLETE_FILES: + # Make sure that the string actually has a match + matches = [i.startswith(comp_start) for i in comp_lists[0]] + if not any(matches): + return self.autocompletewindow = self._make_autocomplete_window() self.autocompletewindow.show_window(comp_lists, "insert-%dc" % len(comp_start),

AltStyle によって変換されたページ (->オリジナル) /