Skip to content

Commit 62e87d9

Browse files
authored
Merge pull request #28 from SublimeLinter/sl4
sl4 compatibility
2 parents 4ecd091 + c04b67b commit 62e87d9

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

linter.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
"""This module exports the Coffeelint plugin class."""
1313

14-
from SublimeLinter.lint import Linter, persist
14+
import SublimeLinter
15+
from SublimeLinter.lint import Linter, persist, util
1516

1617

1718
class Coffeelint(Linter):
@@ -37,8 +38,14 @@ def cmd(self):
3738
"""Return a tuple with the command line to execute."""
3839

3940
command = [self.executable_path, '--reporter', 'jslint', '--stdin']
41+
api_version = getattr(SublimeLinter, 'VERSION', 3)
4042

41-
if persist.get_syntax(self.view) == 'coffeescript_literate':
43+
if api_version > 3:
44+
current_syntax = util.get_syntax(self.view)
45+
else:
46+
current_syntax = persist.get_syntax(self.view)
47+
48+
if current_syntax == 'coffeescript_literate':
4249
command.append('--literate')
4350

4451
return command

0 commit comments

Comments
 (0)