Skip to content

Commit 5d156b0

Browse files
committed
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 )
1 parent fc5c97a commit 5d156b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

autofilename.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def on_query_completions(self, view, prefix, locations):
122122
valid_scopes = self.get_setting('afn_valid_scopes',view)
123123
sel = view.sel()[0].a
124124
completions = []
125+
126+
if "string.regexp.js" in view.scope_name(sel):
127+
return []
125128

126129
if not any(s in view.scope_name(sel) for s in valid_scopes):
127130
return []
@@ -154,4 +157,4 @@ def on_query_completions(self, view, prefix, locations):
154157
return completions
155158
except OSError:
156159
print "AutoFileName: could not find " + this_dir
157-
return
160+
return

0 commit comments

Comments
 (0)