Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax: Restrict AssignSyntaxTestSyntaxListener #366

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion plugins/syntaxtest_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,15 @@ class AssignSyntaxTestSyntaxListener(sublime_plugin.EventListener):
PLAIN_TEXT = "Packages/Text/Plain text.tmLanguage"

def on_load(self, view):
if view.size() == 0 and view.file_name().startswith(sublime.packages_path() + '/'):
file_name = view.file_name()
if not file_name:
return
folder_name, file_name = path.split(file_name)
if not file_name.startswith('syntax_test_'):
return
if not folder_name.startswith(sublime.packages_path()):
return
if view.size() == 0:
logger.debug("Delaying on_load because view was empty")
sublime.set_timeout(lambda: self._on_load(view), 100)
else:
Expand Down