fix annoying bug in JavaScript regex literals

Now it doesn't block ST for erroneously working inside a JS regex (e.g. /\b[a-z]/gi )
This commit is contained in:
Ivan
2013-07-06 17:44:33 -05:00
parent fc5c97af0c
commit 5d156b0992

View File

@@ -122,6 +122,9 @@ class FileNameComplete(sublime_plugin.EventListener):
valid_scopes = self.get_setting('afn_valid_scopes',view)
sel = view.sel()[0].a
completions = []
if "string.regexp.js" in view.scope_name(sel):
return []
if not any(s in view.scope_name(sel) for s in valid_scopes):
return []
@@ -154,4 +157,4 @@ class FileNameComplete(sublime_plugin.EventListener):
return completions
except OSError:
print "AutoFileName: could not find " + this_dir
return
return