From a75dcba2d7d44760d40c40292a863b4422c6ede7 Mon Sep 17 00:00:00 2001 From: Liam Cain Date: Sat, 21 Jan 2012 20:04:41 -0500 Subject: [PATCH] Fix for windows (I hope...) --- autofilename.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autofilename.py b/autofilename.py index 0019e0e..fd659b2 100644 --- a/autofilename.py +++ b/autofilename.py @@ -6,7 +6,7 @@ class FileNameComplete(sublime_plugin.EventListener): completions = [] sel = view.sel()[0].a - if "/" in view.substr(sublime.Region(sel-2,sel)): + if os.path.sep in view.substr(sublime.Region(sel-2,sel)): if "string" in view.scope_name(sel): pass elif "css" in view.scope_name(sel): @@ -16,20 +16,20 @@ class FileNameComplete(sublime_plugin.EventListener): else: return [] - this_dir = os.path.split(view.file_name())[0] + "/" + this_dir = os.path.split(view.file_name())[0] + os.path.sep cur_path = view.substr(view.extract_scope(sel-1)) if cur_path.startswith(("'","\"")): cur_path = cur_path[1:-1] - this_dir += cur_path + this_dir = os.path.join(this_dir, cur_path) try: dir_files = os.listdir(this_dir) for d in dir_files: if not '.' in d: - d += '/' + d += os.path.sep completions.append(d.decode('utf-8')) return [(x, x) for x in list(set(completions))] except OSError: