TextMateTheme@load will load absolute paths

This commit is contained in:
Corey Johnson
2012-12-26 16:57:48 -08:00
parent d2e76b48c3
commit b08422bc6b
3 changed files with 525 additions and 16 deletions

View File

@@ -6,7 +6,12 @@ module.exports =
class TextMateTheme
@load: (name) ->
regex = new RegExp("#{_.escapeRegExp(name)}\.(tmTheme|plist)$", "i")
path = _.find fs.list(config.themeDirPath), (path) -> regex.test(path)
if fs.exists(name)
path = name
else
path = _.find fs.list(config.themeDirPath), (path) -> regex.test(path)
return null unless path
plistString = fs.read(path)