]> granicus.if.org Git - python/commitdiff
Autocompletion of filenames now support alternate separators, e.g. the
authorKurt B. Kaiser <kbk@shore.net>
Sun, 27 Apr 2008 21:52:19 +0000 (21:52 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Sun, 27 Apr 2008 21:52:19 +0000 (21:52 +0000)
'/' char on Windows.  Patch 2061 Tal Einat.

Lib/idlelib/AutoComplete.py
Lib/idlelib/NEWS.txt

index bed2b8c4cd09c7b54162f62793b58d7a12155c4f..1c74d2ebd0c64a67f2c623cdcc28dd2d6657d423 100644 (file)
@@ -23,6 +23,10 @@ ID_CHARS = string.ascii_letters + string.digits + "_"
 # These constants represent the two different types of completions
 COMPLETE_ATTRIBUTES, COMPLETE_FILES = range(1, 2+1)
 
+SEPS = os.sep
+if os.altsep:  # e.g. '/' on Windows...
+    SEPS += os.altsep
+
 class AutoComplete:
 
     menudefs = [
@@ -70,7 +74,7 @@ class AutoComplete:
         if lastchar == ".":
             self._open_completions_later(False, False, False,
                                          COMPLETE_ATTRIBUTES)
-        elif lastchar == os.sep:
+        elif lastchar in SEPS:
             self._open_completions_later(False, False, False,
                                          COMPLETE_FILES)
 
@@ -126,7 +130,7 @@ class AutoComplete:
                 i -= 1
             comp_start = curline[i:j]
             j = i
-            while i and curline[i-1] in FILENAME_CHARS+os.sep:
+            while i and curline[i-1] in FILENAME_CHARS + SEPS:
                 i -= 1
             comp_what = curline[i:j]
         elif hp.is_in_code() and (not mode or mode==COMPLETE_ATTRIBUTES):
index c574d001133560c61cca152a2037f7d2c0cd1642..0b6fa61b75a0053946b8ab8db944bbf36db33706 100644 (file)
@@ -9,7 +9,10 @@ What's New in IDLE 2.6a3?
 - Home / Control-A toggles between left margin and end of leading white
   space.  Patch 1196903 Jeff Shute.
 
-- Improved AutoCompleteWindow logic.  Patch 2062 Tal Einat.  
+- Improved AutoCompleteWindow logic.  Patch 2062 Tal Einat.
+
+- Autocompletion of filenames now support alternate separators, e.g. the
+  '/' char on Windows.  Patch 2061 Tal Einat.
 
 What's New in IDLE 2.6a1?
 =========================