Merge remote-tracking branch 'origin/master' into cj-keymap-cleanup

This commit is contained in:
probablycorey
2013-11-14 14:43:37 -08:00
19 changed files with 90 additions and 61 deletions

View File

@@ -16,7 +16,7 @@ atom][download].
* Install [Visual C++ 2010 Express][win-vs2010]
* Install the [latest 32bit Node 0.10.x][win-node]
* Install the [latest Python 2.7.x][win-python]
* Install [Github for Windows][win-github]
* Install [GitHub for Windows][win-github]
* Clone [atom/atom][atom-git] to `C:\Users\<user>\github\atom\`
* Add `C:\Python27;C:\Program Files\nodejs;C:\Users\<user>\github\atom\node_modules\`
to your PATH

View File

@@ -9,7 +9,7 @@
"bugs": {
"url": "https://github.com/atom/atom/issues"
},
"atomShellVersion": "0.6.9",
"atomShellVersion": "0.6.10",
"dependencies": {
"async": "0.2.6",
"bootstrap": "git://github.com/twbs/bootstrap.git#v3.0.0",
@@ -18,26 +18,26 @@
"coffeestack": "0.6.0",
"emissary": "0.9.0",
"first-mate": "0.5.0",
"fs-plus": "0.7.0",
"fs-plus": "0.9.0",
"fuzzaldrin": "0.1.0",
"git-utils": "0.29.0",
"guid": "0.0.10",
"jasmine-focused": "~0.15.0",
"mkdirp": "0.3.5",
"less-cache": "0.9.0",
"less-cache": "0.10.0",
"nslog": "0.1.0",
"oniguruma": "0.24.0",
"optimist": "0.4.0",
"pathwatcher": "0.9.0",
"pegjs": "0.7.0",
"q": "0.9.7",
"scandal": "0.7.0",
"scandal": "0.8.0",
"season": "0.14.0",
"semver": "1.1.4",
"space-pen": "2.0.0",
"telepath": "0.23.0",
"temp": "0.5.0",
"underscore-plus": "0.2.0"
"underscore-plus": "0.3.0"
},
"devDependencies": {
"biscotto": "0.0.17",
@@ -61,29 +61,29 @@
"jasmine-tagged": "0.2.0",
"request": "~2.27.0",
"unzip": "~0.1.9",
"rcedit": "~0.1.1"
"rcedit": "~0.1.2",
"rimraf": "~2.2.2"
},
"packageDependencies" : {
"packageDependencies": {
"atom-light-ui": "0.6.0",
"atom-light-syntax": "0.6.0",
"atom-dark-ui": "0.6.0",
"atom-dark-syntax": "0.6.0",
"base16-tomorrow-dark-theme": "0.6.0",
"solarized-dark-syntax": "0.4.0",
"archive-view": "0.11.0",
"autocomplete": "0.12.0",
"autoflow": "0.5.0",
"autosave": "0.6.0",
"bookmarks": "0.10.0",
"bracket-matcher": "0.9.0",
"bracket-matcher": "0.11.0",
"command-logger": "0.6.0",
"command-palette": "0.7.0",
"dev-live-reload": "0.14.0",
"dev-live-reload": "0.15.0",
"editor-stats": "0.5.0",
"exception-reporting": "0.5.0",
"find-and-replace": "0.39.0",
"fuzzy-finder": "0.19.0",
"exception-reporting": "0.7.0",
"find-and-replace": "0.40.0",
"fuzzy-finder": "0.20.0",
"gists": "0.6.0",
"git-diff": "0.13.0",
"github-sign-in": "0.9.0",
@@ -92,24 +92,23 @@
"image-view": "0.7.0",
"link": "0.7.0",
"markdown-preview": "0.15.0",
"metrics": "0.8.0",
"package-generator": "0.17.0",
"metrics": "0.11.0",
"package-generator": "0.19.0",
"release-notes": "0.11.0",
"settings-view": "0.37.0",
"settings-view": "0.39.0",
"snippets": "0.13.0",
"spell-check": "0.11.0",
"status-bar": "0.15.1",
"spell-check": "0.13.0",
"status-bar": "0.16.0",
"styleguide": "0.9.0",
"symbols-view": "0.18.0",
"symbols-view": "0.19.0",
"tabs": "0.8.0",
"terminal": "0.15.0",
"terminal": "0.16.0",
"timecop": "0.9.0",
"to-the-hubs": "0.8.0",
"tree-view": "0.28.0",
"to-the-hubs": "0.9.0",
"tree-view": "0.30.0",
"visual-bell": "0.3.0",
"whitespace": "0.8.0",
"wrap-guide": "0.5.0",
"language-c": "0.2.0",
"language-clojure": "0.1.0",
"language-coffee-script": "0.3.0",

BIN
resources/atom.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

View File

@@ -74,6 +74,16 @@ describe "Editor", ->
expect(editor.hiddenInput).toMatchSelector ':focus'
expect($(editor[0]).scrollTop()).toBe 0
expect($(editor.scrollView[0]).scrollTop()).toBe 0
editor.moveCursorToBottom()
editor.hiddenInput.blur()
editor.scrollTop(0)
editor.focus()
expect(editor.hiddenInput).toMatchSelector ':focus'
expect($(editor[0]).scrollTop()).toBe 0
expect($(editor.scrollView[0]).scrollTop()).toBe 0
describe "when the hidden input is focused / unfocused", ->
it "assigns the isFocused flag on the editor and also adds/removes the .focused css class", ->

View File

@@ -6,11 +6,10 @@ Keymap = require '../src/keymap'
describe "Keymap", ->
fragment = null
keymap = null
resourcePath = atom.getLoadSettings().resourcePath
beforeEach ->
keymap = new Keymap
resourcePath: window.resourcePath
configDirPath: atom.getConfigDirPath()
keymap = new Keymap({configDirPath: atom.getConfigDirPath(), resourcePath})
fragment = $ """
<div class="command-mode">
<div class="child-node">

View File

@@ -77,9 +77,10 @@ beforeEach ->
config = new Config
resourcePath: window.resourcePath
configDirPath: atom.getConfigDirPath()
config.packageDirPaths.unshift(fixturePackagesPath)
spyOn(config, 'load')
spyOn(config, 'save')
config.setDefaults('core', RootView.configDefaults)
config.setDefaults('editor', Editor.configDefaults)
config.set "editor.fontFamily", "Courier"
config.set "editor.fontSize", 16
config.set "editor.autoIndent", false

View File

@@ -6,11 +6,11 @@ AtomPackage = require '../src/atom-package'
describe "ThemeManager", ->
themeManager = null
resourcePath = atom.getLoadSettings().resourcePath
configDirPath = atom.getConfigDirPath()
beforeEach ->
themeManager = new ThemeManager
packageManager: atom.packages
resourcePath: window.resourcePath
themeManager = new ThemeManager({packageManager: atom.packages, resourcePath, configDirPath})
afterEach ->
themeManager.deactivateThemes()

View File

@@ -62,9 +62,9 @@ class Atom
@packages = new PackageManager({devMode, configDirPath, resourcePath})
@subscribe @packages, 'activated', => @watchThemes()
@themes = new ThemeManager({packageManager: @packages, resourcePath})
@themes = new ThemeManager({packageManager: @packages, configDirPath, resourcePath})
@contextMenu = new ContextMenuManager(devMode)
@menu = new MenuManager()
@menu = new MenuManager({resourcePath})
@pasteboard = new Pasteboard()
@syntax = deserialize(@getWindowState('syntax')) ? new Syntax()
@@ -241,6 +241,9 @@ class Atom
isFullScreen: ->
@getCurrentWindow().isFullScreen()
getVersion: ->
app.getVersion()
getHomeDirPath: ->
process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']
@@ -251,6 +254,10 @@ class Atom
getConfigDirPath: ->
@configDirPath ?= fs.absolute('~/.atom')
# Public: Get the directory path to Atom's storage area.
getStorageDirPath: ->
@storageDirPath ?= path.join(@getConfigDirPath(), 'storage')
getWindowStatePath: ->
switch @windowMode
when 'spec'
@@ -262,7 +269,7 @@ class Atom
filename = "editor-#{sha1}"
if filename
path.join(@config.userStoragePath, filename)
path.join(@getStorageDirPath(), filename)
else
null
@@ -320,7 +327,7 @@ class Atom
@rootView.trigger 'beep'
requireUserInitScript: ->
userInitScriptPath = path.join(@config.configDirPath, "user.coffee")
userInitScriptPath = path.join(@getConfigDirPath(), "user.coffee")
try
require userInitScriptPath if fs.isFileSync(userInitScriptPath)
catch error

View File

@@ -10,6 +10,8 @@ _ = require 'underscore-plus'
# Private:
module.exports =
class AtomWindow
@iconPath: path.resolve(__dirname, '..', '..', 'atom.png')
browserWindow: null
loaded: null
isSpec: null
@@ -19,7 +21,7 @@ class AtomWindow
global.atomApplication.addWindow(this)
@setupNodePath(@resourcePath)
@browserWindow = new BrowserWindow show: false, title: 'Atom'
@browserWindow = new BrowserWindow show: false, title: 'Atom', icon: @constructor.iconPath
@browserWindow.restart = _.wrap _.bind(@browserWindow.restart, @browserWindow), (restart) =>
@setupNodePath(@resourcePath)
restart()

View File

@@ -33,19 +33,7 @@ class Config
# Private: Created during initialization, available as `global.config`
constructor: ({@configDirPath, @resourcePath}={}) ->
@bundledKeymapsDirPath = path.join(@resourcePath, "keymaps")
@bundledMenusDirPath = path.join(resourcePath, "menus")
@nodeModulesDirPath = path.join(@resourcePath, "node_modules")
@bundledPackageDirPaths = [@nodeModulesDirPath]
@packageDirPaths = [path.join(@configDirPath, "packages")]
if atom.getLoadSettings().devMode
@packageDirPaths.unshift(path.join(@configDirPath, "dev", "packages"))
@userPackageDirPaths = _.clone(@packageDirPaths)
@userStoragePath = path.join(@configDirPath, "storage")
@defaultSettings =
core: _.clone(require('./root-view').configDefaults)
editor: _.clone(require('./editor').configDefaults)
@defaultSettings = {}
@settings = {}
@configFilePath = fs.resolve(@configDirPath, 'config', ['json', 'cson'])
@configFilePath ?= path.join(@configDirPath, 'config.cson')

View File

@@ -644,6 +644,7 @@ class Editor extends View
false
@hiddenInput.on 'focus', =>
@bringHiddenInputIntoView()
@isFocused = true
@addClass 'is-focused'

View File

@@ -216,7 +216,8 @@ class Git
#
# Returns a Number representing the status.
getDirectoryStatus: (directoryPath) ->
directoryPath = "#{directoryPath}/"
{sep} = require 'path'
directoryPath = "#{directoryPath}#{sep}"
directoryStatus = 0
for path, status of @statuses
directoryStatus |= status if path.indexOf(directoryPath) is 0

View File

@@ -30,13 +30,12 @@ class Keymap
bindingSetsByFirstKeystroke: null
queuedKeystroke: null
constructor: ({resourcePath, @configDirPath})->
@bundledKeymapsDirPath = path.join(resourcePath, "keymaps")
constructor: ({@resourcePath, @configDirPath})->
@bindingSets = []
@bindingSetsByFirstKeystroke = {}
loadBundledKeymaps: ->
@loadDirectory(@bundledKeymapsDirPath)
@loadDirectory(path.join(@resourcePath, 'keymaps'))
@emit('bundled-keymaps-loaded')
loadUserKeymap: ->

View File

@@ -12,7 +12,7 @@ fs = require 'fs-plus'
module.exports =
class MenuManager
# Private:
constructor: ->
constructor: ({@resourcePath}) ->
@template = []
atom.keymap.on 'bundled-keymaps-loaded', => @loadCoreItems()
@@ -38,7 +38,8 @@ class MenuManager
# Private
loadCoreItems: ->
menuPaths = fs.listSync(atom.config.bundledMenusDirPath, ['cson', 'json'])
menusDirPath = path.join(@resourcePath, 'menus')
menuPaths = fs.listSync(menusDirPath, ['cson', 'json'])
for menuPath in menuPaths
data = CSON.readFileSync(menuPath)
@add(data.menu)

View File

@@ -40,6 +40,12 @@ class PackageManager
getApmPath: ->
@apmPath ?= require.resolve('atom-package-manager/bin/apm')
# Public: Get the paths being used to look for packages.
#
# Returns an Array of String directory paths.
getPackageDirPaths: ->
_.clone(@packageDirPaths)
getPackageState: (name) ->
@packageStates[name]
@@ -188,6 +194,18 @@ class PackageManager
{engines} = Package.loadMetadata(packagePath, true)
engines?.atom?
isBundledPackage: (packageName) ->
@getPackageDependencies().hasOwnProperty(packageName)
getPackageDependencies: ->
unless @packageDependencies?
try
metadataPath = path.join(@resourcePath, 'package.json')
{@packageDependencies} = JSON.parse(fs.readFileSync(metadataPath)) ? {}
@packageDependencies ?= {}
@packageDependencies
getAvailablePackagePaths: ->
packagePaths = []
@@ -195,11 +213,8 @@ class PackageManager
for packagePath in fs.listSync(packageDirPath)
packagePaths.push(packagePath) if fs.isDirectorySync(packagePath)
try
metadataPath = path.join(@resourcePath, 'package.json')
{packageDependencies} = JSON.parse(fs.readFileSync(metadataPath)) ? {}
packagesPath = path.join(@resourcePath, 'node_modules')
for packageName, packageVersion of packageDependencies ? {}
for packageName, packageVersion of @getPackageDependencies()
packagePath = path.join(packagesPath, packageName)
packagePaths.push(packagePath) if fs.isDirectorySync(packagePath)

View File

@@ -165,6 +165,7 @@ class Project
# Public: Make the given path relative to the project directory.
relativize: (fullPath) ->
return fullPath if fullPath?.match(/[A-Za-z0-9+-.]+:\/\//) # leave path alone if it has a scheme
@rootDirectory?.relativize(fullPath) ? fullPath
# Public: Returns whether the given path is inside this project.

View File

@@ -17,7 +17,7 @@ module.exports =
class ThemeManager
Emitter.includeInto(this)
constructor: ({@packageManager, @resourcePath}) ->
constructor: ({@packageManager, @resourcePath, @configDirPath}) ->
@lessCache = null
@packageManager.registerPackageActivator(this, ['theme'])
@@ -87,7 +87,7 @@ class ThemeManager
# Public:
getUserStylesheetPath: ->
stylesheetPath = fs.resolve(path.join(atom.config.configDirPath, 'user'), ['css', 'less'])
stylesheetPath = fs.resolve(path.join(@configDirPath, 'user'), ['css', 'less'])
if fs.isFileSync(stylesheetPath)
stylesheetPath
else

View File

@@ -49,6 +49,8 @@ window.startEditorWindow = ->
windowEventHandler = new WindowEventHandler
atom.restoreDimensions()
atom.config.load()
atom.config.setDefaults('core', require('./root-view').configDefaults)
atom.config.setDefaults('editor', require('./editor').configDefaults)
atom.keymap.loadBundledKeymaps()
atom.themes.loadBaseStylesheets()
atom.packages.loadPackages()

View File

@@ -22,6 +22,9 @@ module.exports = (grunt) ->
cp 'atom.sh', path.join(appDir, 'atom.sh')
cp 'package.json', path.join(appDir, 'package.json')
iconPath = path.resolve(__dirname, '..', 'resources', 'atom.png')
cp iconPath, path.join(appDir, 'atom.png')
packageDirectories = []
nonPackageDirectories = [
'benchmark'