diff --git a/docs/building-atom.md b/docs/building-atom.md index b7bf280b1..b2ea2414a 100644 --- a/docs/building-atom.md +++ b/docs/building-atom.md @@ -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\\github\atom\` * Add `C:\Python27;C:\Program Files\nodejs;C:\Users\\github\atom\node_modules\` to your PATH diff --git a/package.json b/package.json index 157095029..27526058e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/resources/atom.png b/resources/atom.png new file mode 100755 index 000000000..f3be42c3d Binary files /dev/null and b/resources/atom.png differ diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index a765d15e5..ac8bb3614 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -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", -> diff --git a/spec/keymap-spec.coffee b/spec/keymap-spec.coffee index 982a6a50e..044797d9c 100644 --- a/spec/keymap-spec.coffee +++ b/spec/keymap-spec.coffee @@ -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 = $ """
diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 95f6618c9..ffc2bdba8 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -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 diff --git a/spec/theme-manager-spec.coffee b/spec/theme-manager-spec.coffee index c788ef4ca..c5dc74974 100644 --- a/spec/theme-manager-spec.coffee +++ b/spec/theme-manager-spec.coffee @@ -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() diff --git a/src/atom.coffee b/src/atom.coffee index af9d90c92..2dfc70a68 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -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 diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index 5b6fe6e36..576d5d6f5 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -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() diff --git a/src/config.coffee b/src/config.coffee index 64a6e96cb..a4eedfdc6 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -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') diff --git a/src/editor.coffee b/src/editor.coffee index 7ee6cd12f..db11812fe 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -644,6 +644,7 @@ class Editor extends View false @hiddenInput.on 'focus', => + @bringHiddenInputIntoView() @isFocused = true @addClass 'is-focused' diff --git a/src/git.coffee b/src/git.coffee index c1fb57853..c9f64eed9 100644 --- a/src/git.coffee +++ b/src/git.coffee @@ -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 diff --git a/src/keymap.coffee b/src/keymap.coffee index aaf44785a..bb7694038 100644 --- a/src/keymap.coffee +++ b/src/keymap.coffee @@ -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: -> diff --git a/src/menu-manager.coffee b/src/menu-manager.coffee index 9d730122f..174812aae 100644 --- a/src/menu-manager.coffee +++ b/src/menu-manager.coffee @@ -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) diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 76a85cd73..4cf3191e1 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -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) diff --git a/src/project.coffee b/src/project.coffee index f523c450a..8357c452f 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -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. diff --git a/src/theme-manager.coffee b/src/theme-manager.coffee index b2f592cc1..d0c97bc55 100644 --- a/src/theme-manager.coffee +++ b/src/theme-manager.coffee @@ -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 diff --git a/src/window.coffee b/src/window.coffee index 032cb2de4..6be8a3e9d 100644 --- a/src/window.coffee +++ b/src/window.coffee @@ -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() diff --git a/tasks/build-task.coffee b/tasks/build-task.coffee index 3ea047635..d7a41b776 100644 --- a/tasks/build-task.coffee +++ b/tasks/build-task.coffee @@ -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'