Skip to content

Commit 299ce8a

Browse files
authored
Merge pull request #75 from markbirbeck/74-syntax-definitions
74 syntax definitions
2 parents e635c5e + 7838e79 commit 299ce8a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

SublimeHelper.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,16 @@ def __init__(self, window, data_key, command, working_dir, title=None, syntax=No
217217
# Set the syntax for the output:
218218
#
219219
if syntax is not None:
220-
resources = sublime.find_resources(syntax + '.tmLanguage')
221-
self.console.set_syntax_file(resources[0])
220+
if not (syntax.endswith('.tmLanguage') or
221+
syntax.endswith('.sublime-syntax')):
222+
syntax += '.tmLanguage'
223+
resources = sublime.find_resources(syntax)
224+
225+
if not resources:
226+
print('No resource found matching "%s". Using it as full syntax path.' % syntax)
227+
self.console.set_syntax_file(syntax)
228+
else:
229+
self.console.set_syntax_file(resources[0])
222230

223231
# Set a flag on the view that we can use in key bindings:
224232
#

0 commit comments

Comments
 (0)