removing second lookup in requireStylesheet

This commit is contained in:
Jon Rohan
2013-01-22 12:40:31 -08:00
parent 01b9594e21
commit 9be6d67c7e

View File

@@ -72,10 +72,7 @@ windowAdditions =
requireStylesheet: (path) ->
if fullPath = require.resolve(path)
window.applyStylesheet(fullPath, fs.read(fullPath))
for theme in atom.loadedThemes
for themePath, css of theme.stylesheets
matched = true if themePath.match(path)
unless fullPath || matched
unless fullPath
throw new Error("Could not find a file at path '#{path}'")
removeStylesheet: (path) ->