mirror of
https://github.com/zhigang1992/AutoFileName.git
synced 2026-01-12 17:12:38 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user