Merge branch 'master' into chrome31

Conflicts:
	package.json
This commit is contained in:
Cheng Zhao
2014-01-16 20:30:03 +08:00
4 changed files with 21 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.46.0",
"version": "0.47.0",
"main": "./src/browser/main.js",
"repository": {
"type": "git",
@@ -49,7 +49,7 @@
"text-buffer": "0.13.0",
"underscore-plus": "0.6.1",
"vm-compatibility-layer": "0.1.0",
"theorist": "~0.13.0",
"theorist": "~0.14.0",
"delegato": "~0.4.0",
"mixto": "~0.4.0",
"property-accessors": "~0.1.0"
@@ -75,7 +75,7 @@
"editor-stats": "0.12.0",
"exception-reporting": "0.11.0",
"feedback": "0.22.0",
"find-and-replace": "0.75.0",
"find-and-replace": "0.76.0",
"fuzzy-finder": "0.31.0",
"gists": "0.15.0",
"git-diff": "0.22.0",

View File

@@ -73,7 +73,7 @@ describe 'File', ->
fs.moveSync(filePath, newPath)
waitsFor "move event", ->
waitsFor "move event", 30000, ->
moveHandler.callCount > 0
runs ->

View File

@@ -38,8 +38,8 @@ describe "ThemeManager", ->
# syntax theme is not a dir at this time, so only two.
expect(paths.length).toBe 2
expect(paths[0]).toContain 'atom-dark-ui'
expect(paths[1]).toContain 'atom-light-ui'
expect(paths[0]).toContain 'atom-light-ui'
expect(paths[1]).toContain 'atom-dark-ui'
it "ignores themes that cannot be resolved to a directory", ->
atom.config.set('core.themes', ['definitely-not-a-theme'])

View File

@@ -42,19 +42,26 @@ class ThemeManager
# Internal-only: adhere to the PackageActivator interface
activatePackages: (themePackages) -> @activateThemes()
# Private: Get the enabled theme names from the config.
#
# Returns an array of theme names in the order that they should be activated.
getEnabledThemeNames: ->
themeNames = atom.config.get('core.themes') ? []
themeNames = [themeNames] unless _.isArray(themeNames)
# Reverse so the first (top) theme is loaded after the others. We want
# the first/top theme to override later themes in the stack.
themeNames.reverse()
# Internal-only:
activateThemes: ->
# atom.config.observe runs the callback once, then on subsequent changes.
atom.config.observe 'core.themes', (themeNames) =>
atom.config.observe 'core.themes', =>
@deactivateThemes()
themeNames = [themeNames] unless _.isArray(themeNames)
# Reverse so the first (top) theme is loaded after the others. We want
# the first/top theme to override later themes in the stack.
themeNames = _.clone(themeNames).reverse()
@refreshLessCache() # Update cache for packages in core.themes config
@packageManager.activatePackage(themeName) for themeName in themeNames
for themeName in @getEnabledThemeNames()
@packageManager.activatePackage(themeName)
@refreshLessCache() # Update cache again now that @getActiveThemes() is populated
@loadUserStylesheet()
@@ -85,7 +92,7 @@ class ThemeManager
themePaths = (theme.getStylesheetsPath() for theme in activeThemes when theme)
else
themePaths = []
for themeName in atom.config.get('core.themes') ? []
for themeName in @getEnabledThemeNames()
if themePath = @packageManager.resolvePackagePath(themeName)
themePaths.push(path.join(themePath, AtomPackage.stylesheetsDir))