From d227d8b64611a2333468e9c861b6ae5fb66b2150 Mon Sep 17 00:00:00 2001 From: Chen Shen Date: Wed, 2 Dec 2015 16:57:23 -0800 Subject: [PATCH 01/91] Add config to disable autoupdate, revert previous build option --- build/Gruntfile.coffee | 3 +- build/tasks/build-task.coffee | 1 - build/tasks/disable-autoupdate-task.coffee | 12 -------- src/browser/application-menu.coffee | 9 ++---- src/browser/atom-application.coffee | 3 +- src/browser/auto-update-manager.coffee | 33 ++++++++++++++-------- src/config-schema.coffee | 4 +++ src/config.coffee | 2 +- 8 files changed, 31 insertions(+), 36 deletions(-) delete mode 100644 build/tasks/disable-autoupdate-task.coffee diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index 26d9c2f42..e4bb656c1 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -36,7 +36,6 @@ module.exports = (grunt) -> buildDir = grunt.option('build-dir') buildDir ?= path.join(os.tmpdir(), 'atom-build') buildDir = path.resolve(buildDir) - disableAutoUpdate = grunt.option('no-auto-update') ? false channel = grunt.option('channel') releasableBranches = ['stable', 'beta'] @@ -179,7 +178,7 @@ module.exports = (grunt) -> pkg: grunt.file.readJSON('package.json') atom: { - appName, channel, metadata, disableAutoUpdate, + appName, channel, metadata, appFileName, apmFileName, appDir, buildDir, contentsDir, installDir, shellAppDir, symbolsDir, } diff --git a/build/tasks/build-task.coffee b/build/tasks/build-task.coffee index 213aa0da4..a86c7c1f4 100644 --- a/build/tasks/build-task.coffee +++ b/build/tasks/build-task.coffee @@ -186,5 +186,4 @@ module.exports = (grunt) -> dependencies = ['compile', 'generate-license:save', 'generate-module-cache', 'compile-packages-slug'] dependencies.push('copy-info-plist') if process.platform is 'darwin' dependencies.push('set-exe-icon') if process.platform is 'win32' - dependencies.push('disable-autoupdate') if grunt.config.get('atom.disableAutoUpdate') grunt.task.run(dependencies...) diff --git a/build/tasks/disable-autoupdate-task.coffee b/build/tasks/disable-autoupdate-task.coffee deleted file mode 100644 index 7517543da..000000000 --- a/build/tasks/disable-autoupdate-task.coffee +++ /dev/null @@ -1,12 +0,0 @@ -fs = require 'fs' -path = require 'path' - -module.exports = (grunt) -> - - grunt.registerTask 'disable-autoupdate', 'Set up disableAutoUpdate field in package.json file', -> - appDir = fs.realpathSync(grunt.config.get('atom.appDir')) - - metadata = grunt.file.readJSON(path.join(appDir, 'package.json')) - metadata._disableAutoUpdate = grunt.config.get('atom.disableAutoUpdate') - - grunt.file.write(path.join(appDir, 'package.json'), JSON.stringify(metadata)) diff --git a/src/browser/application-menu.coffee b/src/browser/application-menu.coffee index 27b9df8e1..74da80e43 100644 --- a/src/browser/application-menu.coffee +++ b/src/browser/application-menu.coffee @@ -103,8 +103,6 @@ class ApplicationMenu downloadingUpdateItem.visible = false installUpdateItem.visible = false - return if @autoUpdateManager.isDisabled() - switch state when 'idle', 'error', 'no-update-available' checkForUpdateItem.visible = true @@ -119,9 +117,10 @@ class ApplicationMenu # # Returns an Array of menu item Objects. getDefaultTemplate: -> - template = [ + [ label: "Atom" submenu: [ + {label: "Check for Update", metadata: {autoUpdate: true}} {label: 'Reload', accelerator: 'Command+R', click: => @focusedWindow()?.reload()} {label: 'Close Window', accelerator: 'Command+Shift+W', click: => @focusedWindow()?.close()} {label: 'Toggle Dev Tools', accelerator: 'Command+Alt+I', click: => @focusedWindow()?.toggleDevTools()} @@ -129,10 +128,6 @@ class ApplicationMenu ] ] - # Add `Check for Update` button if autoUpdateManager is enabled. - template[0].submenu.unshift({label: "Check for Update", metadata: {autoUpdate: true}}) unless @autoUpdateManager.isDisabled() - template - focusedWindow: -> _.find global.atomApplication.windows, (atomWindow) -> atomWindow.isFocused() diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index e720597e3..d8b2257b7 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -74,8 +74,7 @@ class AtomApplication @pidsToOpenWindows = {} @windows = [] - disableAutoUpdate = require(path.join(@resourcePath, 'package.json'))._disableAutoUpdate ? false - @autoUpdateManager = new AutoUpdateManager(@version, options.test, disableAutoUpdate) + @autoUpdateManager = new AutoUpdateManager(@version, options.test, @resourcePath) @applicationMenu = new ApplicationMenu(@version, @autoUpdateManager) @atomProtocolHandler = new AtomProtocolHandler(@resourcePath, @safeMode) diff --git a/src/browser/auto-update-manager.coffee b/src/browser/auto-update-manager.coffee index 55ab2462b..00c00fedd 100644 --- a/src/browser/auto-update-manager.coffee +++ b/src/browser/auto-update-manager.coffee @@ -1,5 +1,6 @@ autoUpdater = null _ = require 'underscore-plus' +Config = require '../config' {EventEmitter} = require 'events' path = require 'path' @@ -15,10 +16,13 @@ module.exports = class AutoUpdateManager _.extend @prototype, EventEmitter.prototype - constructor: (@version, @testMode, @disabled) -> + constructor: (@version, @testMode, resourcePath) -> @state = IdleState @iconPath = path.resolve(__dirname, '..', '..', 'resources', 'atom.png') @feedUrl = "https://atom.io/api/updates?version=#{@version}" + @config = new Config({configDirPath: process.env.ATOM_HOME, resourcePath, enablePersistence: true}) + @config.setSchema null, {type: 'object', properties: _.clone(require('../config-schema'))} + @config.load() process.nextTick => @setupAutoUpdater() setupAutoUpdater: -> @@ -46,9 +50,13 @@ class AutoUpdateManager @setState(UpdateAvailableState) @emitUpdateAvailableEvent(@getWindows()...) - # Only check for updates periodically if enabled and running in release - # version. - @scheduleUpdateCheck() unless /\w{7}/.test(@version) or @disabled + @config.onDidChange 'core.enableAutoupdate', ({newValue}) => + if newValue + @scheduleUpdateCheck() + else + @cancelScheduledUpdateCheck() + + @scheduleUpdateCheck() if @config.get 'core.enableAutoupdate' switch process.platform when 'win32' @@ -56,9 +64,6 @@ class AutoUpdateManager when 'linux' @setState(UnsupportedState) - isDisabled: -> - @disabled - emitUpdateAvailableEvent: (windows...) -> return unless @releaseVersion? for atomWindow in windows @@ -74,10 +79,16 @@ class AutoUpdateManager @state scheduleUpdateCheck: -> - checkForUpdates = => @check(hidePopups: true) - fourHours = 1000 * 60 * 60 * 4 - setInterval(checkForUpdates, fourHours) - checkForUpdates() + unless @checkForUpdatesIntervalID + checkForUpdates = => @check(hidePopups: true) + fourHours = 1000 * 60 * 60 * 4 + @checkForUpdatesIntervalID = setInterval(checkForUpdates, fourHours) + checkForUpdates() + + cancelScheduledUpdateCheck: -> + if @checkForUpdatesIntervalID + clearInterval(@checkForUpdatesIntervalID) + @checkForUpdatesIntervalID = null check: ({hidePopups}={}) -> unless hidePopups diff --git a/src/config-schema.coffee b/src/config-schema.coffee index d9c0c1d21..f1e5e8bbd 100644 --- a/src/config-schema.coffee +++ b/src/config-schema.coffee @@ -104,6 +104,10 @@ module.exports = description: 'Automatically open an empty editor on startup.' type: 'boolean' default: true + enableAutoupdate: + description: 'Automatically update Atom when new release is available.' + type: 'boolean' + default: true editor: type: 'object' diff --git a/src/config.coffee b/src/config.coffee index 2e4387732..c680cf415 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -820,7 +820,7 @@ class Config @watchSubscription = null notifyFailure: (errorMessage, detail) -> - @notificationManager.addError(errorMessage, {detail, dismissable: true}) + @notificationManager.addError(errorMessage, {detail, dismissable: true}) if @notificationManager save: -> return if @shouldNotAccessFileSystem() From ea3736aa703708e94a0b2e41e8e1ece3e991480d Mon Sep 17 00:00:00 2001 From: Chen Shen Date: Fri, 11 Dec 2015 10:36:01 -0800 Subject: [PATCH 02/91] address comments --- src/browser/auto-update-manager.coffee | 8 +++++--- src/config-schema.coffee | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/browser/auto-update-manager.coffee b/src/browser/auto-update-manager.coffee index 00c00fedd..612702a67 100644 --- a/src/browser/auto-update-manager.coffee +++ b/src/browser/auto-update-manager.coffee @@ -50,13 +50,13 @@ class AutoUpdateManager @setState(UpdateAvailableState) @emitUpdateAvailableEvent(@getWindows()...) - @config.onDidChange 'core.enableAutoupdate', ({newValue}) => + @config.onDidChange 'core.enableAutoUpdate', ({newValue}) => if newValue @scheduleUpdateCheck() else @cancelScheduledUpdateCheck() - @scheduleUpdateCheck() if @config.get 'core.enableAutoupdate' + @scheduleUpdateCheck() if @config.get 'core.enableAutoUpdate' switch process.platform when 'win32' @@ -79,7 +79,9 @@ class AutoUpdateManager @state scheduleUpdateCheck: -> - unless @checkForUpdatesIntervalID + # Only schedule update check periodically if running in release version and + # and there is no existing scheduled update check. + unless /\w{7}/.test(@version) or @checkForUpdatesIntervalID checkForUpdates = => @check(hidePopups: true) fourHours = 1000 * 60 * 60 * 4 @checkForUpdatesIntervalID = setInterval(checkForUpdates, fourHours) diff --git a/src/config-schema.coffee b/src/config-schema.coffee index f1e5e8bbd..31dd980bb 100644 --- a/src/config-schema.coffee +++ b/src/config-schema.coffee @@ -104,8 +104,8 @@ module.exports = description: 'Automatically open an empty editor on startup.' type: 'boolean' default: true - enableAutoupdate: - description: 'Automatically update Atom when new release is available.' + enableAutoUpdate: + description: 'Automatically update Atom when a new release is available.' type: 'boolean' default: true From 6c0643b4faa559e349d425eeb8527cf91cddb87a Mon Sep 17 00:00:00 2001 From: Chen Shen Date: Tue, 15 Dec 2015 14:04:09 -0800 Subject: [PATCH 03/91] address comments --- src/browser/auto-update-manager.coffee | 4 ++-- src/config-schema.coffee | 2 +- src/config.coffee | 13 +++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/browser/auto-update-manager.coffee b/src/browser/auto-update-manager.coffee index 612702a67..6a008d44d 100644 --- a/src/browser/auto-update-manager.coffee +++ b/src/browser/auto-update-manager.coffee @@ -50,13 +50,13 @@ class AutoUpdateManager @setState(UpdateAvailableState) @emitUpdateAvailableEvent(@getWindows()...) - @config.onDidChange 'core.enableAutoUpdate', ({newValue}) => + @config.onDidChange 'core.automaticallyUpdate', ({newValue}) => if newValue @scheduleUpdateCheck() else @cancelScheduledUpdateCheck() - @scheduleUpdateCheck() if @config.get 'core.enableAutoUpdate' + @scheduleUpdateCheck() if @config.get 'core.automaticallyUpdate' switch process.platform when 'win32' diff --git a/src/config-schema.coffee b/src/config-schema.coffee index 31dd980bb..88e00c71d 100644 --- a/src/config-schema.coffee +++ b/src/config-schema.coffee @@ -104,7 +104,7 @@ module.exports = description: 'Automatically open an empty editor on startup.' type: 'boolean' default: true - enableAutoUpdate: + automaticallyUpdate: description: 'Automatically update Atom when a new release is available.' type: 'boolean' default: true diff --git a/src/config.coffee b/src/config.coffee index c680cf415..2a883a57d 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -779,9 +779,14 @@ class Config loadUserConfig: -> return if @shouldNotAccessFileSystem() - unless fs.existsSync(@configFilePath) - fs.makeTreeSync(path.dirname(@configFilePath)) - CSON.writeFileSync(@configFilePath, {}) + try + unless fs.existsSync(@configFilePath) + fs.makeTreeSync(path.dirname(@configFilePath)) + CSON.writeFileSync(@configFilePath, {}) + catch error + @configFileHasErrors = true + @notifyFailure("Failed to initialize `#{path.basename(@configFilePath)}`", error.stack) + return try unless @savePending @@ -820,7 +825,7 @@ class Config @watchSubscription = null notifyFailure: (errorMessage, detail) -> - @notificationManager.addError(errorMessage, {detail, dismissable: true}) if @notificationManager + @notificationManager?.addError(errorMessage, {detail, dismissable: true}) save: -> return if @shouldNotAccessFileSystem() From a706a77fd99a4b20356b9a0c78b11f5a6b662dd9 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Sat, 19 Dec 2015 16:06:56 +0100 Subject: [PATCH 04/91] Add time-grunt to benchmark each task time --- build/Gruntfile.coffee | 2 ++ build/package.json | 1 + 2 files changed, 3 insertions(+) diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index 26d9c2f42..63afc2fd7 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -14,6 +14,8 @@ _ = require 'underscore-plus' packageJson = require '../package.json' module.exports = (grunt) -> + require('time-grunt')(grunt) + grunt.loadNpmTasks('grunt-babel') grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('grunt-lesslint') diff --git a/build/package.json b/build/package.json index fd7d29d80..d5c780c08 100644 --- a/build/package.json +++ b/build/package.json @@ -37,6 +37,7 @@ "runas": "^3.1", "tello": "1.0.5", "temp": "~0.8.1", + "time-grunt": "1.2.2", "underscore-plus": "1.x", "unzip": "~0.1.9", "vm-compatibility-layer": "~0.1.0", From 4e0b2c0c21e24c3d8685e0cb16735dc291c39ef2 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Sat, 19 Dec 2015 16:20:27 +0100 Subject: [PATCH 05/91] Print package/modules (un)installation times --- script/bootstrap | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/script/bootstrap b/script/bootstrap index 8314b9cb0..5f9241a3d 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -5,8 +5,16 @@ var verifyRequirements = require('./utils/verify-requirements'); var safeExec = require('./utils/child-process-wrapper.js').safeExec; var path = require('path'); +var t0, t1 + // Executes an array of commands one by one. function executeCommands(commands, done, index) { + if (index != undefined) { + t1 = Date.now() + console.log("=> Took " + (t1 - t0) + "ms."); + console.log(); + } + index = (index == undefined ? 0 : index); if (index < commands.length) { var command = commands[index]; @@ -17,6 +25,7 @@ function executeCommands(commands, done, index) { options = command.options; command = command.command; } + t0 = Date.now() safeExec(command, options, executeCommands.bind(this, commands, done, index + 1)); } else @@ -96,7 +105,10 @@ function bootstrap() { message: 'Installing apm...', options: apmInstallOptions }, - apmPath + ' clean' + apmFlags, + { + command: apmPath + ' clean' + apmFlags, + message: 'Deleting old packages...' + }, moduleInstallCommand, dedupeApmCommand + ' ' + packagesToDedupe.join(' '), ]; From 943cc86045df84285670ba73cb70851bc931970c Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 20 Dec 2015 12:09:47 -0500 Subject: [PATCH 06/91] :arrow_up: language-git@0.11.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8e058ae67..72c8a14ae 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "language-csharp": "0.11.0", "language-css": "0.36.0", "language-gfm": "0.82.0", - "language-git": "0.11.0", + "language-git": "0.11.1", "language-go": "0.41.0", "language-html": "0.43.1", "language-hyperlink": "0.16.0", From d5e0f21389122cbe82bce158947ad591ebbe369d Mon Sep 17 00:00:00 2001 From: Tunghsiao Liu Date: Mon, 21 Dec 2015 12:44:18 +0800 Subject: [PATCH 07/91] Prevent committing `blob-store` --- dot-atom/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/dot-atom/.gitignore b/dot-atom/.gitignore index 81af3f689..569a62297 100644 --- a/dot-atom/.gitignore +++ b/dot-atom/.gitignore @@ -1,5 +1,6 @@ storage compile-cache dev +blob-store .npm .node-gyp From 754552cb476d60da7045748465b3651d736552ac Mon Sep 17 00:00:00 2001 From: Tunghsiao Liu Date: Mon, 21 Dec 2015 12:45:21 +0800 Subject: [PATCH 08/91] Reorder ignored items for .atom --- dot-atom/.gitignore | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dot-atom/.gitignore b/dot-atom/.gitignore index 569a62297..e5c80ce23 100644 --- a/dot-atom/.gitignore +++ b/dot-atom/.gitignore @@ -1,6 +1,6 @@ -storage +blob-store compile-cache dev -blob-store -.npm +storage .node-gyp +.npm From 357af1e997c376334123b37c11018a4095cc4c89 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 21 Dec 2015 08:01:22 -0500 Subject: [PATCH 09/91] :arrow_down: language-git@0.11.0 Specs need to be updated --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 72c8a14ae..8e058ae67 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "language-csharp": "0.11.0", "language-css": "0.36.0", "language-gfm": "0.82.0", - "language-git": "0.11.1", + "language-git": "0.11.0", "language-go": "0.41.0", "language-html": "0.43.1", "language-hyperlink": "0.16.0", From d094eb8ef1d0b82d5b85e7dafb39532fbb30d0a4 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 21 Dec 2015 10:39:22 -0700 Subject: [PATCH 10/91] :arrow_up: event-kit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8e058ae67..dd661ccd4 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "clear-cut": "^2.0.1", "coffee-script": "1.8.0", "color": "^0.7.3", - "event-kit": "^1.3.0", + "event-kit": "^1.5.0", "find-parent-dir": "^0.3.0", "first-mate": "^5.1.1", "fs-plus": "^2.8.0", From b7c4655c28e54f6db7ef8dbefd53bec41a11a22c Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 21 Dec 2015 17:52:31 -0500 Subject: [PATCH 11/91] :arrow_up: language-javascript@0.105.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd661ccd4..d9abfe276 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "language-html": "0.43.1", "language-hyperlink": "0.16.0", "language-java": "0.17.0", - "language-javascript": "0.104.0", + "language-javascript": "0.105.0", "language-json": "0.17.2", "language-less": "0.29.0", "language-make": "0.21.0", From 5d85ea18ae48c9c9fd54931630a99a4d44962a9e Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 21 Dec 2015 20:08:36 -0500 Subject: [PATCH 12/91] :arrow_up: language-php@0.36.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d9abfe276..2ac4df46b 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "language-mustache": "0.13.0", "language-objective-c": "0.15.1", "language-perl": "0.32.0", - "language-php": "0.34.0", + "language-php": "0.36.0", "language-property-list": "0.8.0", "language-python": "0.42.1", "language-ruby": "0.65.0", From 27cc953c07252266e25309f28408a3a23c52031f Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 01:08:28 -0800 Subject: [PATCH 13/91] Destroy pending item when new item is activated --- src/pane.coffee | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/pane.coffee b/src/pane.coffee index 412fc5251..3b698c444 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -337,14 +337,18 @@ class Pane extends Model # # * `index` {Number} activateItemAtIndex: (index) -> - @activateItem(@itemAtIndex(index)) + @setActiveItem(@itemAtIndex(index)) # Public: Make the given item *active*, causing it to be displayed by # the pane's view. activateItem: (item) -> if item? - @addItem(item, @getActiveItemIndex() + 1, false) - @setActiveItem(item) + if @activeItem?.isPending() + index = @getActiveItemIndex() + @destroyActiveItem() + else + index = @getActiveItemIndex() + 1 + @addItem(item, index, false) # Public: Add the given item to the pane. # @@ -358,14 +362,16 @@ class Pane extends Model throw new Error("Pane items must be objects. Attempted to add item #{item}.") unless item? and typeof item is 'object' throw new Error("Adding a pane item with URI '#{item.getURI?()}' that has already been destroyed") if item.isDestroyed?() - return if item in @items + if item in @items + @setActiveItem(item) + return if typeof item.onDidDestroy is 'function' @itemSubscriptions.set item, item.onDidDestroy => @removeItem(item, false) @items.splice(index, 0, item) @emitter.emit 'did-add-item', {item, index, moved} - @setActiveItem(item) unless @getActiveItem()? + @setActiveItem(item) item # Public: Add the given items to the pane. From b24250289e81ee2464217d2655597a69fc796b26 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 01:10:42 -0800 Subject: [PATCH 14/91] Add pending status to text editors Add event methods for 'did-confirm-pending-state'. --- src/text-editor.coffee | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 1435aef19..f769646dc 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -92,9 +92,10 @@ class TextEditor extends Model softWrapped, @displayBuffer, @selectionsMarkerLayer, buffer, suppressCursorCreation, @mini, @placeholderText, lineNumberGutterVisible, largeFileMode, @config, @notificationManager, @packageManager, @clipboard, @viewRegistry, @grammarRegistry, - @project, @assert, @applicationDelegate + @project, @assert, @applicationDelegate, @pending } = params + throw new Error("Must pass a config parameter when constructing TextEditors") unless @config? throw new Error("Must pass a notificationManager parameter when constructing TextEditors") unless @notificationManager? throw new Error("Must pass a packageManager parameter when constructing TextEditors") unless @packageManager? @@ -161,6 +162,9 @@ class TextEditor extends Model @disposables.add @buffer.onDidChangeEncoding => @emitter.emit 'did-change-encoding', @getEncoding() @disposables.add @buffer.onDidDestroy => @destroy() + if @pending + @disposables.add @buffer.onDidChangeModified => + @confirmPendingState() if @buffer.isModified() @preserveCursorPositionOnBufferReload() @@ -569,6 +573,13 @@ class TextEditor extends Model getEditorWidthInChars: -> @displayBuffer.getEditorWidthInChars() + onDidConfirmPendingState: (callback) -> + @emitter.on 'did-confirm-pending-state', callback + + confirmPendingState: -> + @pending = false + @emitter.emit 'did-confirm-pending-state', this + ### Section: File Details ### @@ -652,6 +663,9 @@ class TextEditor extends Model # Essential: Returns {Boolean} `true` if this editor has no content. isEmpty: -> @buffer.isEmpty() + # Returns {Boolean} `true` if this editor is pending and `false` if it is permanent. + isPending: -> Boolean(@pending) + # Copies the current file path to the native clipboard. copyPathToClipboard: -> if filePath = @getPath() From 219ebea98b08a5f8b7463f3ef5ad81249863a7cb Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 01:31:19 -0800 Subject: [PATCH 15/91] Fix bug in ::activate Item Check if isPending function exists on item before invoking. --- src/pane.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pane.coffee b/src/pane.coffee index 3b698c444..4e97e8bdc 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -343,7 +343,7 @@ class Pane extends Model # the pane's view. activateItem: (item) -> if item? - if @activeItem?.isPending() + if @activeItem?.isPending?() index = @getActiveItemIndex() @destroyActiveItem() else From 4c4e16ac3bd2b1cc7ec2416ead90ae33f769d077 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 12:29:22 -0800 Subject: [PATCH 16/91] Fix bug in ::activateItem Only destroy active item if it is not the same as the new item. --- src/pane.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pane.coffee b/src/pane.coffee index 4e97e8bdc..b0758f4c4 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -345,7 +345,7 @@ class Pane extends Model if item? if @activeItem?.isPending?() index = @getActiveItemIndex() - @destroyActiveItem() + @destroyActiveItem() unless item is @activeItem else index = @getActiveItemIndex() + 1 @addItem(item, index, false) @@ -580,7 +580,6 @@ class Pane extends Model # Public: Makes this pane the *active* pane, causing it to gain focus. activate: -> throw new Error("Pane has been destroyed") if @isDestroyed() - @container?.setActivePane(this) @emitter.emit 'did-activate' From e26ae05597c5c45726b1b5340a5a3ece418f6234 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 13:34:58 -0800 Subject: [PATCH 17/91] Fix bug in ::activateItemAtIndex Revert to original code to conform to specs. --- src/pane.coffee | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pane.coffee b/src/pane.coffee index b0758f4c4..21d74b3d7 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -337,7 +337,7 @@ class Pane extends Model # # * `index` {Number} activateItemAtIndex: (index) -> - @setActiveItem(@itemAtIndex(index)) + @activateItem(@itemAtIndex(index)) # Public: Make the given item *active*, causing it to be displayed by # the pane's view. @@ -349,6 +349,7 @@ class Pane extends Model else index = @getActiveItemIndex() + 1 @addItem(item, index, false) + @setActiveItem(item) # Public: Add the given item to the pane. # @@ -362,16 +363,14 @@ class Pane extends Model throw new Error("Pane items must be objects. Attempted to add item #{item}.") unless item? and typeof item is 'object' throw new Error("Adding a pane item with URI '#{item.getURI?()}' that has already been destroyed") if item.isDestroyed?() - if item in @items - @setActiveItem(item) - return + return if item in @items if typeof item.onDidDestroy is 'function' @itemSubscriptions.set item, item.onDidDestroy => @removeItem(item, false) @items.splice(index, 0, item) @emitter.emit 'did-add-item', {item, index, moved} - @setActiveItem(item) + @setActiveItem(item) unless @getActiveItem() item # Public: Add the given items to the pane. From 63b5ddbd9952c7ef10c769de5f7d23fe27d626f1 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 13:58:59 -0800 Subject: [PATCH 18/91] Handle out-of-bound indices for ::activateItemAtIndex --- src/pane.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pane.coffee b/src/pane.coffee index 21d74b3d7..70687227a 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -337,7 +337,8 @@ class Pane extends Model # # * `index` {Number} activateItemAtIndex: (index) -> - @activateItem(@itemAtIndex(index)) + item = @itemAtIndex(index) or @getActiveItem() + @setActiveItem(item) # Public: Make the given item *active*, causing it to be displayed by # the pane's view. @@ -370,7 +371,7 @@ class Pane extends Model @items.splice(index, 0, item) @emitter.emit 'did-add-item', {item, index, moved} - @setActiveItem(item) unless @getActiveItem() + @setActiveItem(item) unless @getActiveItem()? item # Public: Add the given items to the pane. From cca9ea4b608c9e40cc673372fa438b2de5c6a4f5 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 17:56:18 -0800 Subject: [PATCH 19/91] Rename onDidConfirmPendingState for clarity Now it is called onDidTerminatePendingState. --- src/text-editor.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index f769646dc..e54734257 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -164,7 +164,7 @@ class TextEditor extends Model @disposables.add @buffer.onDidDestroy => @destroy() if @pending @disposables.add @buffer.onDidChangeModified => - @confirmPendingState() if @buffer.isModified() + @terminatePendingState() if @buffer.isModified() @preserveCursorPositionOnBufferReload() @@ -573,10 +573,10 @@ class TextEditor extends Model getEditorWidthInChars: -> @displayBuffer.getEditorWidthInChars() - onDidConfirmPendingState: (callback) -> + onDidTerminatePendingState: (callback) -> @emitter.on 'did-confirm-pending-state', callback - confirmPendingState: -> + terminatePendingState: -> @pending = false @emitter.emit 'did-confirm-pending-state', this From fa86d2d1568c326900953b247aae3679e170a07b Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 17:57:08 -0800 Subject: [PATCH 20/91] Add tests for pending status --- spec/text-editor-spec.coffee | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index 02d2e4a96..c51ec41d7 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -5804,3 +5804,20 @@ describe "TextEditor", -> screenRange: marker1.getRange(), rangeIsReversed: false } + + describe "pending state", -> + editor1 = null + beforeEach -> + waitsForPromise -> + atom.workspace.open('sample.txt', pending: true).then (o) -> editor1 = o + + it "should open file in pending state if 'pending' option is true", -> + expect(editor1.isPending()).toBe true + expect(editor.isPending()).toBe false # By default pending status is false + + it "invokes ::onDidTerminatePendingState observers if pending status is removed", -> + events = [] + editor1.onDidTerminatePendingState (event) -> events.push(event) + editor1.terminatePendingState() + expect(editor1.isPending()).toBe false + expect(events).toEqual [editor1] From 7f57b0ada488845675d9bda5d31137ded3866979 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 18:02:07 -0800 Subject: [PATCH 21/91] Change event to 'did-terminate-pending-state' --- src/text-editor.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index e54734257..55a7b026f 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -574,11 +574,11 @@ class TextEditor extends Model @displayBuffer.getEditorWidthInChars() onDidTerminatePendingState: (callback) -> - @emitter.on 'did-confirm-pending-state', callback + @emitter.on 'did-terminate-pending-state', callback terminatePendingState: -> @pending = false - @emitter.emit 'did-confirm-pending-state', this + @emitter.emit 'did-terminate-pending-state', this ### Section: File Details From 217e07530feead0d3295d1577d589e814cc437a0 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 18:43:57 -0800 Subject: [PATCH 22/91] Add test: modified buffer terminates pending state Test not yet passing. ::insertText is not triggering terminatePendingState. Not sure why... --- spec/text-editor-spec.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index c51ec41d7..225a1485a 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -5821,3 +5821,11 @@ describe "TextEditor", -> editor1.terminatePendingState() expect(editor1.isPending()).toBe false expect(events).toEqual [editor1] + + it "should terminate pending state when buffer is changed", -> + events = [] + editor1.onDidTerminatePendingState (event) -> events.push(event) + expect(editor1.isPending()).toBe true + editor1.insertText('I\'ll be back!') + expect(editor1.isPending()).toBe false + expect(events).toEqual [editor1] From def62fc6c7849b3b2c705939cee02848d7332432 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Thu, 24 Dec 2015 21:42:00 -0800 Subject: [PATCH 23/91] Fix test: modified buffer terminates pending state --- spec/text-editor-spec.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index 225a1485a..686bb6868 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -5827,5 +5827,6 @@ describe "TextEditor", -> editor1.onDidTerminatePendingState (event) -> events.push(event) expect(editor1.isPending()).toBe true editor1.insertText('I\'ll be back!') + advanceClock(500) expect(editor1.isPending()).toBe false expect(events).toEqual [editor1] From 7024e000a81c1e6fb05150da9013a84abadd270e Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 30 Dec 2015 14:32:55 -0500 Subject: [PATCH 24/91] Provide some defaults. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we’ll get: TypeError: Cannot read property 'pathToOpen' of undefined when called from ‘application:new-file’. --- src/browser/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index e720597e3..c8b417386 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -370,7 +370,7 @@ class AtomApplication # :safeMode - Boolean to control the opened window's safe mode. # :profileStartup - Boolean to control creating a profile of the startup time. # :window - {AtomWindow} to open file paths in. - openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup, window}) -> + openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup, window} = {}) -> @openPaths({pathsToOpen: [pathToOpen], pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup, window}) # Public: Opens multiple paths, in existing windows if possible. From 5c14d3e99b795f045bbdbe56cd6b9adc334ca386 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 30 Dec 2015 14:33:23 -0500 Subject: [PATCH 25/91] Don't fail if `event` is undefined. Unclear why this is undefined, but apparently it is. --- src/browser/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index c8b417386..04c2d3824 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -229,7 +229,7 @@ class AtomApplication @openUrl({urlToOpen, @devMode, @safeMode}) app.on 'activate-with-no-open-windows', (event) => - event.preventDefault() + event?.preventDefault() @emit('application:new-window') # A request from the associated render process to open a new render process. From a63e70148d9a5a6d32b445c158fe07db189b46ba Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 30 Dec 2015 17:33:45 -0500 Subject: [PATCH 26/91] Cascade new windows on OS X Fixes #10057. --- src/browser/atom-application.coffee | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index e720597e3..a77591159 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -167,7 +167,7 @@ class AtomApplication safeMode: @focusedWindow()?.safeMode @on 'application:quit', -> app.quit() - @on 'application:new-window', -> @openPath(_.extend(windowDimensions: @focusedWindow()?.getDimensions(), getLoadSettings())) + @on 'application:new-window', -> @openPath(getLoadSettings()) @on 'application:new-file', -> (@focusedWindow() ? this).openPath() @on 'application:open', -> @promptForPathToOpen('all', getLoadSettings()) @on 'application:open-file', -> @promptForPathToOpen('file', getLoadSettings()) @@ -360,6 +360,15 @@ class AtomApplication focusedWindow: -> _.find @windows, (atomWindow) -> atomWindow.isFocused() + # Get the dimensions for opening a new window by cascading as appropriate. + getDimensionsForNewWindow: -> + dimensions = (@focusedWindow() ? @lastFocusedWindow)?.getDimensions() + # On OS X, new windows cascade down and to the right. + if dimensions? and process.platform is 'darwin' + dimensions.x += 20 + dimensions.y += 20 + dimensions + # Public: Opens a single path, in an existing window if possible. # # options - @@ -417,6 +426,7 @@ class AtomApplication windowInitializationScript ?= require.resolve('../initialize-application-window') resourcePath ?= @resourcePath + windowDimensions ?= @getDimensionsForNewWindow() openedWindow = new AtomWindow({locationsToOpen, windowInitializationScript, resourcePath, devMode, safeMode, windowDimensions, profileStartup}) if pidToKillWhenClosed? From 9e7cb15c2c056f99fb1f228758ef2e846549178f Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 12:05:42 -0500 Subject: [PATCH 27/91] Offset on Windows too. --- src/browser/atom-application.coffee | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index a77591159..b91adabac 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -360,13 +360,18 @@ class AtomApplication focusedWindow: -> _.find @windows, (atomWindow) -> atomWindow.isFocused() - # Get the dimensions for opening a new window by cascading as appropriate. + # Get the dimensions for opening a new window by cascading as appropriate to + # the platform. getDimensionsForNewWindow: -> - dimensions = (@focusedWindow() ? @lastFocusedWindow)?.getDimensions() - # On OS X, new windows cascade down and to the right. - if dimensions? and process.platform is 'darwin' - dimensions.x += 20 - dimensions.y += 20 + offsetByPlatform = + darwin: 22 + win32: 26 + + dimensions = @windows[@windows.length - 1]?.getDimensions() + offset = offsetByPlatform[process.platform] + if dimensions? and offset? + dimensions.x += offset + dimensions.y += offset dimensions # Public: Opens a single path, in an existing window if possible. From dcd860ae6fb4249ad20536b75618c9590425cb1d Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 12:18:48 -0500 Subject: [PATCH 28/91] Use the last focused window instead of the last opened window. --- src/browser/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index b91adabac..fe21ae107 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -367,7 +367,7 @@ class AtomApplication darwin: 22 win32: 26 - dimensions = @windows[@windows.length - 1]?.getDimensions() + dimensions = (@focusedWindow() ? @lastFocusedWindow)?.getDimensions() offset = offsetByPlatform[process.platform] if dimensions? and offset? dimensions.x += offset From b25e7f025ca028006a2bfb58ea3d4e443e0aaa22 Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 14:46:16 -0500 Subject: [PATCH 29/91] :arrow_up: git-utils@4.0.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2ac4df46b..927af044e 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "fs-plus": "^2.8.0", "fstream": "0.1.24", "fuzzaldrin": "^2.1", - "git-utils": "^4.0.7", + "git-utils": "^4.0.8", "grim": "1.5.0", "jasmine-json": "~0.0", "jasmine-tagged": "^1.1.4", From b4035547c27beb24dda28d2d6ba127448c24eae2 Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 17:05:50 -0500 Subject: [PATCH 30/91] Use .getStatusForPaths. --- src/git-repository.coffee | 6 +++++- src/repository-status-handler.coffee | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/git-repository.coffee b/src/git-repository.coffee index 1663f9ad4..ee27f87a5 100644 --- a/src/git-repository.coffee +++ b/src/git-repository.coffee @@ -463,8 +463,12 @@ class GitRepository refreshStatus: -> @handlerPath ?= require.resolve('./repository-status-handler') + relativeProjectPaths = @project?.getPaths() + .map (path) => @relativize(path) + .filter (path) -> path.length > 0 + @statusTask?.terminate() - @statusTask = Task.once @handlerPath, @getPath(), ({statuses, upstream, branch, submodules}) => + @statusTask = Task.once @handlerPath, @getPath(), relativeProjectPaths, ({statuses, upstream, branch, submodules}) => statusesUnchanged = _.isEqual(statuses, @statuses) and _.isEqual(upstream, @upstream) and _.isEqual(branch, @branch) and diff --git a/src/repository-status-handler.coffee b/src/repository-status-handler.coffee index d0763fd5a..2fda9a335 100644 --- a/src/repository-status-handler.coffee +++ b/src/repository-status-handler.coffee @@ -1,7 +1,7 @@ Git = require 'git-utils' path = require 'path' -module.exports = (repoPath) -> +module.exports = (repoPath, paths = []) -> repo = Git.open(repoPath) upstream = {} @@ -12,7 +12,8 @@ module.exports = (repoPath) -> if repo? # Statuses in main repo workingDirectoryPath = repo.getWorkingDirectory() - for filePath, status of repo.getStatus() + repoStatus = (if paths.length > 0 then repo.getStatusForPaths(paths) else repo.getStatus()) + for filePath, status of repoStatus statuses[filePath] = status # Statuses in submodules From 876928f7f6bfd3670496f4e4dc91d94aab9540b8 Mon Sep 17 00:00:00 2001 From: Kevin J Date: Sat, 2 Jan 2016 16:05:21 -0500 Subject: [PATCH 31/91] Update function documentation for scrollToScreenPosition --- src/text-editor.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 1435aef19..91b1409a4 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -3037,7 +3037,7 @@ class TextEditor extends Model # Essential: Scrolls the editor to the given screen position. # - # * `screenPosition` An object that represents a buffer position. It can be either + # * `screenPosition` An object that represents a screen position. It can be either # an {Object} (`{row, column}`), {Array} (`[row, column]`), or {Point} # * `options` (optional) {Object} # * `center` Center the editor around the position if possible. (default: false) From c1c67b682ccb7a7a71b404ad9ba4a4694d2c4f11 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 3 Jan 2016 18:58:51 -0500 Subject: [PATCH 32/91] :arrow_up: language-ruby@0.66.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 927af044e..73ba84ba7 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "language-php": "0.36.0", "language-property-list": "0.8.0", "language-python": "0.42.1", - "language-ruby": "0.65.0", + "language-ruby": "0.66.0", "language-ruby-on-rails": "0.24.0", "language-sass": "0.45.0", "language-shellscript": "0.21.0", From 31030275a8cda213d2021486f5299da0eba8e22d Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 3 Jan 2016 18:59:11 -0500 Subject: [PATCH 33/91] :arrow_up: language-ruby-on-rails@0.25.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 73ba84ba7..0ad2ffae9 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "language-property-list": "0.8.0", "language-python": "0.42.1", "language-ruby": "0.66.0", - "language-ruby-on-rails": "0.24.0", + "language-ruby-on-rails": "0.25.0", "language-sass": "0.45.0", "language-shellscript": "0.21.0", "language-source": "0.9.0", From ab3cb1778a74f8e06ae31664e07927bdfca2652f Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 4 Jan 2016 09:40:54 -0500 Subject: [PATCH 34/91] :arrow_up: language-ruby@0.67.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ad2ffae9..f6c38b9c8 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "language-php": "0.36.0", "language-property-list": "0.8.0", "language-python": "0.42.1", - "language-ruby": "0.66.0", + "language-ruby": "0.67.0", "language-ruby-on-rails": "0.25.0", "language-sass": "0.45.0", "language-shellscript": "0.21.0", From 6ee36b14b1774583f7d5305ea74edc945f0a3fa7 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 4 Jan 2016 09:58:19 -0800 Subject: [PATCH 35/91] Prepare 1.3.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5710de92d..959be0793 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.3.2", + "version": "1.3.3", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From ba24364a89c2a0427e8fda270af768d54d667a35 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 4 Jan 2016 09:58:29 -0800 Subject: [PATCH 36/91] :arrow_up: text-buffer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 959be0793..1cb27543a 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "service-hub": "^0.7.0", "source-map-support": "^0.3.2", "temp": "0.8.1", - "text-buffer": "8.0.4", + "text-buffer": "8.0.4-hotfix.1", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" From a962bba3a1299a7e27955c3c63dd3a16af4418ce Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 4 Jan 2016 16:24:47 -0500 Subject: [PATCH 37/91] :arrow_up: git-utils@4.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f6c38b9c8..591e1a2a0 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "fs-plus": "^2.8.0", "fstream": "0.1.24", "fuzzaldrin": "^2.1", - "git-utils": "^4.0.8", + "git-utils": "^4.1.0", "grim": "1.5.0", "jasmine-json": "~0.0", "jasmine-tagged": "^1.1.4", From 9f6fbacddd8d4fb51e24b3b79d9a709d1bdaa0ad Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 4 Jan 2016 16:32:38 -0700 Subject: [PATCH 38/91] =?UTF-8?q?Don=E2=80=99t=20clip=20screen=20positions?= =?UTF-8?q?=20in=20yardstick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By clipping positions only in the TextEditorComponent, we can ensure that we check for the presence of a rendered line for the clipped row value. --- spec/fake-lines-yardstick.coffee | 3 +- spec/lines-yardstick-spec.coffee | 51 ++++++++++++++++---------------- src/lines-yardstick.coffee | 5 +--- src/text-editor-component.coffee | 7 +++-- src/text-editor-presenter.coffee | 22 +++++++------- 5 files changed, 45 insertions(+), 43 deletions(-) diff --git a/spec/fake-lines-yardstick.coffee b/spec/fake-lines-yardstick.coffee index da5f8327e..a2568b959 100644 --- a/spec/fake-lines-yardstick.coffee +++ b/spec/fake-lines-yardstick.coffee @@ -19,9 +19,8 @@ class FakeLinesYardstick setScopedCharacterWidth: (scopeNames, character, width) -> @getScopedCharacterWidths(scopeNames)[character] = width - pixelPositionForScreenPosition: (screenPosition, clip=true) -> + pixelPositionForScreenPosition: (screenPosition) -> screenPosition = Point.fromObject(screenPosition) - screenPosition = @model.clipScreenPosition(screenPosition) if clip targetRow = screenPosition.row targetColumn = screenPosition.column diff --git a/spec/lines-yardstick-spec.coffee b/spec/lines-yardstick-spec.coffee index 74f5fca6a..3520d6935 100644 --- a/spec/lines-yardstick-spec.coffee +++ b/spec/lines-yardstick-spec.coffee @@ -1,5 +1,6 @@ LinesYardstick = require "../src/lines-yardstick" {toArray} = require 'underscore-plus' +{Point} = require 'text-buffer' describe "LinesYardstick", -> [editor, mockLineNodesProvider, createdLineNodes, linesYardstick, buildLineNode] = [] @@ -62,12 +63,12 @@ describe "LinesYardstick", -> } """ - expect(linesYardstick.pixelPositionForScreenPosition([0, 0])).toEqual({left: 0, top: 0}) - expect(linesYardstick.pixelPositionForScreenPosition([0, 1])).toEqual({left: 7, top: 0}) - expect(linesYardstick.pixelPositionForScreenPosition([0, 5])).toEqual({left: 37.78125, top: 0}) - expect(linesYardstick.pixelPositionForScreenPosition([1, 6])).toEqual({left: 43.171875, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([1, 9])).toEqual({left: 72.171875, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([2, Infinity])).toEqual({left: 287.859375, top: 28}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 0))).toEqual({left: 0, top: 0}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 1))).toEqual({left: 7, top: 0}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 5))).toEqual({left: 37.78125, top: 0}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 6))).toEqual({left: 43.171875, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 9))).toEqual({left: 72.171875, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(2, Infinity))).toEqual({left: 287.859375, top: 28}) it "reuses already computed pixel positions unless it is invalidated", -> atom.styles.addStyleSheet """ @@ -77,9 +78,9 @@ describe "LinesYardstick", -> } """ - expect(linesYardstick.pixelPositionForScreenPosition([1, 2])).toEqual({left: 19.203125, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([2, 6])).toEqual({left: 57.609375, top: 28}) - expect(linesYardstick.pixelPositionForScreenPosition([5, 10])).toEqual({left: 95.609375, top: 70}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 2))).toEqual({left: 19.203125, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(2, 6))).toEqual({left: 57.609375, top: 28}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(5, 10))).toEqual({left: 95.609375, top: 70}) atom.styles.addStyleSheet """ * { @@ -87,15 +88,15 @@ describe "LinesYardstick", -> } """ - expect(linesYardstick.pixelPositionForScreenPosition([1, 2])).toEqual({left: 19.203125, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([2, 6])).toEqual({left: 57.609375, top: 28}) - expect(linesYardstick.pixelPositionForScreenPosition([5, 10])).toEqual({left: 95.609375, top: 70}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 2))).toEqual({left: 19.203125, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(2, 6))).toEqual({left: 57.609375, top: 28}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(5, 10))).toEqual({left: 95.609375, top: 70}) linesYardstick.invalidateCache() - expect(linesYardstick.pixelPositionForScreenPosition([1, 2])).toEqual({left: 24, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([2, 6])).toEqual({left: 72, top: 28}) - expect(linesYardstick.pixelPositionForScreenPosition([5, 10])).toEqual({left: 120, top: 70}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 2))).toEqual({left: 24, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(2, 6))).toEqual({left: 72, top: 28}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(5, 10))).toEqual({left: 120, top: 70}) it "correctly handles RTL characters", -> atom.styles.addStyleSheet """ @@ -106,13 +107,13 @@ describe "LinesYardstick", -> """ editor.setText("السلام عليكم") - expect(linesYardstick.pixelPositionForScreenPosition([0, 0]).left).toBe 0 - expect(linesYardstick.pixelPositionForScreenPosition([0, 1]).left).toBe 8 - expect(linesYardstick.pixelPositionForScreenPosition([0, 2]).left).toBe 16 - expect(linesYardstick.pixelPositionForScreenPosition([0, 5]).left).toBe 33 - expect(linesYardstick.pixelPositionForScreenPosition([0, 7]).left).toBe 50 - expect(linesYardstick.pixelPositionForScreenPosition([0, 9]).left).toBe 67 - expect(linesYardstick.pixelPositionForScreenPosition([0, 11]).left).toBe 84 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 0)).left).toBe 0 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 1)).left).toBe 8 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 2)).left).toBe 16 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 5)).left).toBe 33 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 7)).left).toBe 50 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 9)).left).toBe 67 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 11)).left).toBe 84 it "doesn't report a width greater than 0 when the character to measure is at the beginning of a text node", -> # This spec documents what seems to be a bug in Chromium, because we'd @@ -137,9 +138,9 @@ describe "LinesYardstick", -> editor.setText(text) - expect(linesYardstick.pixelPositionForScreenPosition([0, 35]).left).toBe 230.90625 - expect(linesYardstick.pixelPositionForScreenPosition([0, 36]).left).toBe 237.5 - expect(linesYardstick.pixelPositionForScreenPosition([0, 37]).left).toBe 244.09375 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 35)).left).toBe 230.90625 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 36)).left).toBe 237.5 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 37)).left).toBe 244.09375 describe "::screenPositionForPixelPosition(pixelPosition)", -> it "converts pixel positions to screen positions", -> diff --git a/src/lines-yardstick.coffee b/src/lines-yardstick.coffee index bd8219e81..9edbbe17a 100644 --- a/src/lines-yardstick.coffee +++ b/src/lines-yardstick.coffee @@ -77,10 +77,7 @@ class LinesYardstick else Point(row, column) - pixelPositionForScreenPosition: (screenPosition, clip=true) -> - screenPosition = Point.fromObject(screenPosition) - screenPosition = @model.clipScreenPosition(screenPosition) if clip - + pixelPositionForScreenPosition: (screenPosition) -> targetRow = screenPosition.row targetColumn = screenPosition.column diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 6a84c8dac..03644241b 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -434,12 +434,15 @@ class TextEditorComponent getVisibleRowRange: -> @presenter.getVisibleRowRange() - pixelPositionForScreenPosition: (screenPosition, clip) -> + pixelPositionForScreenPosition: (screenPosition, clip=true) -> + screenPosition = Point.fromObject(screenPosition) + screenPosition = @editor.clipScreenPosition(screenPosition) if clip + unless @presenter.isRowVisible(screenPosition.row) @presenter.setScreenRowsToMeasure([screenPosition.row]) @updateSyncPreMeasurement() - pixelPosition = @linesYardstick.pixelPositionForScreenPosition(screenPosition, clip) + pixelPosition = @linesYardstick.pixelPositionForScreenPosition(screenPosition) @presenter.clearScreenRowsToMeasure() pixelPosition diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 1912f4c2e..6841cf70e 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -433,7 +433,7 @@ class TextEditorPresenter else screenPosition = decoration.getMarker().getHeadScreenPosition() - pixelPosition = @pixelPositionForScreenPosition(screenPosition, true) + pixelPosition = @pixelPositionForScreenPosition(screenPosition) top = pixelPosition.top + @lineHeight left = pixelPosition.left + @gutterWidth @@ -649,8 +649,10 @@ class TextEditorPresenter updateHorizontalDimensions: -> if @baseCharacterWidth? oldContentWidth = @contentWidth - clip = @model.tokenizedLineForScreenRow(@model.getLongestScreenRow())?.isSoftWrapped() - @contentWidth = @pixelPositionForScreenPosition([@model.getLongestScreenRow(), @model.getMaxScreenLineLength()], clip).left + rightmostPosition = Point(@model.getLongestScreenRow(), @model.getMaxScreenLineLength()) + if @model.tokenizedLineForScreenRow(rightmostPosition.row)?.isSoftWrapped() + rightmostPosition = @model.clipScreenPosition(rightmostPosition) + @contentWidth = @pixelPositionForScreenPosition(rightmostPosition).left @contentWidth += @scrollLeft @contentWidth += 1 unless @model.isSoftWrapped() # account for cursor width @@ -966,9 +968,9 @@ class TextEditorPresenter hasPixelPositionRequirements: -> @lineHeight? and @baseCharacterWidth? - pixelPositionForScreenPosition: (screenPosition, clip=true) -> + pixelPositionForScreenPosition: (screenPosition) -> position = - @linesYardstick.pixelPositionForScreenPosition(screenPosition, clip, true) + @linesYardstick.pixelPositionForScreenPosition(screenPosition) position.top -= @getScrollTop() position.left -= @getScrollLeft() @@ -987,14 +989,14 @@ class TextEditorPresenter lineHeight = @model.getLineHeightInPixels() if screenRange.end.row > screenRange.start.row - top = @linesYardstick.pixelPositionForScreenPosition(screenRange.start, true).top + top = @linesYardstick.pixelPositionForScreenPosition(screenRange.start).top left = 0 height = (screenRange.end.row - screenRange.start.row + 1) * lineHeight width = @getScrollWidth() else - {top, left} = @linesYardstick.pixelPositionForScreenPosition(screenRange.start, false) + {top, left} = @linesYardstick.pixelPositionForScreenPosition(screenRange.start) height = lineHeight - width = @linesYardstick.pixelPositionForScreenPosition(screenRange.end, false).left - left + width = @linesYardstick.pixelPositionForScreenPosition(screenRange.end).left - left {top, left, width, height} @@ -1139,8 +1141,8 @@ class TextEditorPresenter buildHighlightRegions: (screenRange) -> lineHeightInPixels = @lineHeight - startPixelPosition = @pixelPositionForScreenPosition(screenRange.start, false) - endPixelPosition = @pixelPositionForScreenPosition(screenRange.end, false) + startPixelPosition = @pixelPositionForScreenPosition(screenRange.start) + endPixelPosition = @pixelPositionForScreenPosition(screenRange.end) spannedRows = screenRange.end.row - screenRange.start.row + 1 regions = [] From 66697036770043d67d834829ecac71f9fa1cfe36 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 4 Jan 2016 16:40:56 -0700 Subject: [PATCH 39/91] =?UTF-8?q?Force=20a=20sync=20render=20when=20measur?= =?UTF-8?q?ing=20if=20we=20don=E2=80=99t=20have=20a=20DOM=20node=20for=20a?= =?UTF-8?q?=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/text-editor-component-spec.js | 7 +++++++ src/text-editor-component.coffee | 2 ++ src/text-editor-presenter.coffee | 3 +++ 3 files changed, 12 insertions(+) diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index d5e9f5425..0546926e3 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -4567,6 +4567,13 @@ describe('TextEditorComponent', function () { }) }) + describe('::pixelPositionForScreenPosition()', () => { + it('returns the correct horizontal position, even if it is on a row that has not yet been rendered (regression)', () => { + editor.setTextInBufferRange([[5, 0], [6, 0]], 'hello world\n') + expect(wrapperNode.pixelPositionForScreenPosition([5, Infinity]).left).toBeGreaterThan(0) + }) + }) + describe('middle mouse paste on Linux', function () { let originalPlatform diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 03644241b..d97d82d04 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -440,6 +440,8 @@ class TextEditorComponent unless @presenter.isRowVisible(screenPosition.row) @presenter.setScreenRowsToMeasure([screenPosition.row]) + + unless @linesComponent.lineNodeForLineIdAndScreenRow(@presenter.lineIdForScreenRow(screenPosition.row), screenPosition.row)? @updateSyncPreMeasurement() pixelPosition = @linesYardstick.pixelPositionForScreenPosition(screenPosition) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 6841cf70e..40ea95514 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -1377,3 +1377,6 @@ class TextEditorPresenter isRowVisible: (row) -> @startRow <= row < @endRow + + lineIdForScreenRow: (screenRow) -> + @model.tokenizedLineForScreenRow(screenRow)?.id From f774e1ce2171a40eac45b8b453ce156a68cb367c Mon Sep 17 00:00:00 2001 From: Chen Shen Date: Mon, 4 Jan 2016 16:55:44 -0800 Subject: [PATCH 40/91] add unittest --- spec/config-spec.coffee | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/config-spec.coffee b/spec/config-spec.coffee index eab2f6f04..c431fea5f 100644 --- a/spec/config-spec.coffee +++ b/spec/config-spec.coffee @@ -872,6 +872,26 @@ describe "Config", -> atom.config.loadUserConfig() expect(atom.config.get("foo.bar")).toBe "baz" + describe "when the config file fails to load", -> + addErrorHandler = null + + beforeEach -> + atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy() + spyOn(fs, "existsSync").andCallFake -> + error = new Error() + error.code = 'EPERM' + throw error + + it "creates a notification and does not try to save later changes to disk", -> + load = -> atom.config.loadUserConfig() + expect(load).not.toThrow() + expect(addErrorHandler.callCount).toBe 1 + + atom.config.set("foo.bar", "baz") + advanceClock(100) + expect(atom.config.save).not.toHaveBeenCalled() + expect(atom.config.get("foo.bar")).toBe "baz" + describe ".observeUserConfig()", -> updatedHandler = null From 38e331691bcda4503b14ea1321147b87465027f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Machist=C3=A9=20N=2E=20Quintana?= Date: Mon, 4 Jan 2016 20:42:23 -0500 Subject: [PATCH 41/91] :arrow_up: apm@1.6.0 --- apm/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apm/package.json b/apm/package.json index b8dda21ea..2e6b0b8ea 100644 --- a/apm/package.json +++ b/apm/package.json @@ -6,6 +6,6 @@ "url": "https://github.com/atom/atom.git" }, "dependencies": { - "atom-package-manager": "1.5.0" + "atom-package-manager": "1.6.0" } } From 94b77d099844c84903b338a6465cc54017a9a62c Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 11:59:59 -0500 Subject: [PATCH 42/91] Separate the offset determination from the dimensions. --- src/browser/atom-application.coffee | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index f6934761a..a5a535b93 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -360,15 +360,18 @@ class AtomApplication focusedWindow: -> _.find @windows, (atomWindow) -> atomWindow.isFocused() - # Get the dimensions for opening a new window by cascading as appropriate to - # the platform. - getDimensionsForNewWindow: -> + # Get the platform-specific window offset for new windows. + getWindowOffsetForCurrentPlatform: -> offsetByPlatform = darwin: 22 win32: 26 + offsetByPlatform[process.platform] ? 0 + # Get the dimensions for opening a new window by cascading as appropriate to + # the platform. + getDimensionsForNewWindow: -> dimensions = (@focusedWindow() ? @lastFocusedWindow)?.getDimensions() - offset = offsetByPlatform[process.platform] + offset = @getWindowOffsetForCurrentPlatform() if dimensions? and offset? dimensions.x += offset dimensions.y += offset From 4ddadcc13580046dacc77b9b7af7198bc199e314 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 12:00:08 -0500 Subject: [PATCH 43/91] Integration test for new window offset. --- spec/integration/helpers/start-atom.coffee | 3 +++ spec/integration/startup-spec.coffee | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/spec/integration/helpers/start-atom.coffee b/spec/integration/helpers/start-atom.coffee index b8768f532..8290a554e 100644 --- a/spec/integration/helpers/start-atom.coffee +++ b/spec/integration/helpers/start-atom.coffee @@ -127,6 +127,9 @@ buildAtomClient = (args, env) -> .execute -> require("remote").require("app").emit("before-quit") .call(done) + .addCommand "getWindowPosition", (cb) -> + @execute((-> atom.getPosition()), cb) + module.exports = (args, env, fn) -> [chromedriver, chromedriverLogs, chromedriverExit] = [] diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index 799c7685f..374078111 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -181,6 +181,25 @@ describe "Starting Atom", -> , 5000) .waitForPaneItemCount(1, 5000) + it "opens a new window offset from the other window", -> + runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> + win0Position = null + win1Position = null + client + .waitForWindowCount(1, 10000) + .getWindowPosition() + .then ({value}) -> win0Position = value + .waitForNewWindow(-> + @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) + , 5000) + .waitForWindowCount(2, 10000) + .getWindowPosition() + .then ({value}) -> win1Position = value + .then -> + offset = atom.getWindowOffsetForCurrentPlatform() + expect(win0Position.x).toEqual(win1Position.x + offset) + expect(win0Position.y).toEqual(win1Position.y + offset) + it "doesn't open a new window if openEmptyEditorOnStart is disabled", -> configPath = path.join(atomHome, 'config.cson') config = CSON.readFileSync(configPath) From c8c8bc941e7c0ae73c2e6e5d7c16ed98d0221188 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 12:27:59 -0500 Subject: [PATCH 44/91] Revert "Integration test for new window offset." This reverts commit 4ddadcc13580046dacc77b9b7af7198bc199e314. --- spec/integration/helpers/start-atom.coffee | 3 --- spec/integration/startup-spec.coffee | 19 ------------------- 2 files changed, 22 deletions(-) diff --git a/spec/integration/helpers/start-atom.coffee b/spec/integration/helpers/start-atom.coffee index 8290a554e..b8768f532 100644 --- a/spec/integration/helpers/start-atom.coffee +++ b/spec/integration/helpers/start-atom.coffee @@ -127,9 +127,6 @@ buildAtomClient = (args, env) -> .execute -> require("remote").require("app").emit("before-quit") .call(done) - .addCommand "getWindowPosition", (cb) -> - @execute((-> atom.getPosition()), cb) - module.exports = (args, env, fn) -> [chromedriver, chromedriverLogs, chromedriverExit] = [] diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index 374078111..799c7685f 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -181,25 +181,6 @@ describe "Starting Atom", -> , 5000) .waitForPaneItemCount(1, 5000) - it "opens a new window offset from the other window", -> - runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> - win0Position = null - win1Position = null - client - .waitForWindowCount(1, 10000) - .getWindowPosition() - .then ({value}) -> win0Position = value - .waitForNewWindow(-> - @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) - , 5000) - .waitForWindowCount(2, 10000) - .getWindowPosition() - .then ({value}) -> win1Position = value - .then -> - offset = atom.getWindowOffsetForCurrentPlatform() - expect(win0Position.x).toEqual(win1Position.x + offset) - expect(win0Position.y).toEqual(win1Position.y + offset) - it "doesn't open a new window if openEmptyEditorOnStart is disabled", -> configPath = path.join(atomHome, 'config.cson') config = CSON.readFileSync(configPath) From 2a29e7d1f4fc63519b06c5095c4f5e59fc4fe911 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 12:48:34 -0500 Subject: [PATCH 45/91] Revert "Revert "Integration test for new window offset."" This reverts commit c8c8bc941e7c0ae73c2e6e5d7c16ed98d0221188. --- spec/integration/helpers/start-atom.coffee | 3 +++ spec/integration/startup-spec.coffee | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/spec/integration/helpers/start-atom.coffee b/spec/integration/helpers/start-atom.coffee index b8768f532..8290a554e 100644 --- a/spec/integration/helpers/start-atom.coffee +++ b/spec/integration/helpers/start-atom.coffee @@ -127,6 +127,9 @@ buildAtomClient = (args, env) -> .execute -> require("remote").require("app").emit("before-quit") .call(done) + .addCommand "getWindowPosition", (cb) -> + @execute((-> atom.getPosition()), cb) + module.exports = (args, env, fn) -> [chromedriver, chromedriverLogs, chromedriverExit] = [] diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index 799c7685f..374078111 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -181,6 +181,25 @@ describe "Starting Atom", -> , 5000) .waitForPaneItemCount(1, 5000) + it "opens a new window offset from the other window", -> + runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> + win0Position = null + win1Position = null + client + .waitForWindowCount(1, 10000) + .getWindowPosition() + .then ({value}) -> win0Position = value + .waitForNewWindow(-> + @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) + , 5000) + .waitForWindowCount(2, 10000) + .getWindowPosition() + .then ({value}) -> win1Position = value + .then -> + offset = atom.getWindowOffsetForCurrentPlatform() + expect(win0Position.x).toEqual(win1Position.x + offset) + expect(win0Position.y).toEqual(win1Position.y + offset) + it "doesn't open a new window if openEmptyEditorOnStart is disabled", -> configPath = path.join(atomHome, 'config.cson') config = CSON.readFileSync(configPath) From 67d49955f136a48cb215a698ab1f06ab3e60d176 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Tue, 5 Jan 2016 10:38:13 -0800 Subject: [PATCH 46/91] Add tests for pending pane items --- spec/pane-spec.coffee | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/pane-spec.coffee b/spec/pane-spec.coffee index 36803bde6..5c5cd9e95 100644 --- a/spec/pane-spec.coffee +++ b/spec/pane-spec.coffee @@ -18,6 +18,8 @@ describe "Pane", -> onDidDestroy: (fn) -> @emitter.on('did-destroy', fn) destroy: -> @destroyed = true; @emitter.emit('did-destroy') isDestroyed: -> @destroyed + isPending: -> @pending + pending: false beforeEach -> confirm = spyOn(atom.applicationDelegate, 'confirm') @@ -153,6 +155,26 @@ describe "Pane", -> pane.activateItem(pane.itemAtIndex(1)) expect(observed).toEqual [pane.itemAtIndex(1)] + it "replaces pending items", -> + itemC = new Item("C") + itemD = new Item("D") + itemC.pending = true + itemD.pending = true + + expect(itemC.isPending()).toBe true + pane.activateItem(itemC) + expect(pane.getItems().length).toBe 3 + expect(pane.getActiveItem()).toBe pane.itemAtIndex(1) + + expect(itemD.isPending()).toBe true + pane.activateItem(itemD) + expect(pane.getItems().length).toBe 3 + expect(pane.getActiveItem()).toBe pane.itemAtIndex(1) + + pane.activateItem(pane.itemAtIndex(2)) + expect(pane.getItems().length).toBe 2 + expect(pane.getActiveItem()).toBe pane.itemAtIndex(1) + describe "::activateNextItem() and ::activatePreviousItem()", -> it "sets the active item to the next/previous item, looping around at either end", -> pane = new Pane(paneParams(items: [new Item("A"), new Item("B"), new Item("C")])) From cee41a2fb0c513c92fc6f056d6ad87f28d951a73 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Tue, 5 Jan 2016 10:42:07 -0800 Subject: [PATCH 47/91] Remove new line --- src/text-editor.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 55a7b026f..7410f8209 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -95,7 +95,6 @@ class TextEditor extends Model @project, @assert, @applicationDelegate, @pending } = params - throw new Error("Must pass a config parameter when constructing TextEditors") unless @config? throw new Error("Must pass a notificationManager parameter when constructing TextEditors") unless @notificationManager? throw new Error("Must pass a packageManager parameter when constructing TextEditors") unless @packageManager? From f64878208f3eb47fff1e80dfe236782e9ca19129 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 14:07:50 -0500 Subject: [PATCH 48/91] Really don't need this to be its own command. --- spec/integration/helpers/start-atom.coffee | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/integration/helpers/start-atom.coffee b/spec/integration/helpers/start-atom.coffee index 8290a554e..b8768f532 100644 --- a/spec/integration/helpers/start-atom.coffee +++ b/spec/integration/helpers/start-atom.coffee @@ -127,9 +127,6 @@ buildAtomClient = (args, env) -> .execute -> require("remote").require("app").emit("before-quit") .call(done) - .addCommand "getWindowPosition", (cb) -> - @execute((-> atom.getPosition()), cb) - module.exports = (args, env, fn) -> [chromedriver, chromedriverLogs, chromedriverExit] = [] From 740e8c660a714b2d52d5688feb2d59dfd90e66de Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 14:08:09 -0500 Subject: [PATCH 49/91] Put it with its friends. --- spec/integration/startup-spec.coffee | 37 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index 374078111..d66bcb077 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -125,6 +125,24 @@ describe "Starting Atom", -> .treeViewRootDirectories() .then ({value}) -> expect(value).toEqual([otherTempDirPath]) + it "opens the new window offset from the other window", -> + runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> + win0Position = null + win1Position = null + client + .waitForWindowCount(1, 10000) + .execute -> atom.getPosition() + .then ({value}) -> win0Position = value + .waitForNewWindow(-> + @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) + , 5000) + .waitForWindowCount(2, 10000) + .execute -> atom.getPosition() + .then ({value}) -> win1Position = value + .then -> + expect(win0Position.x).toEqual(win1Position.x + 22) + expect(win0Position.y).toEqual(win1Position.y + 22) + describe "reopening a directory that was previously opened", -> it "remembers the state of the window", -> runAtom [tempDirPath], {ATOM_HOME: atomHome}, (client) -> @@ -181,25 +199,6 @@ describe "Starting Atom", -> , 5000) .waitForPaneItemCount(1, 5000) - it "opens a new window offset from the other window", -> - runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> - win0Position = null - win1Position = null - client - .waitForWindowCount(1, 10000) - .getWindowPosition() - .then ({value}) -> win0Position = value - .waitForNewWindow(-> - @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) - , 5000) - .waitForWindowCount(2, 10000) - .getWindowPosition() - .then ({value}) -> win1Position = value - .then -> - offset = atom.getWindowOffsetForCurrentPlatform() - expect(win0Position.x).toEqual(win1Position.x + offset) - expect(win0Position.y).toEqual(win1Position.y + offset) - it "doesn't open a new window if openEmptyEditorOnStart is disabled", -> configPath = path.join(atomHome, 'config.cson') config = CSON.readFileSync(configPath) From d224efb00d0b01a073fd75f6523731f5b5567225 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 14:40:09 -0500 Subject: [PATCH 50/91] Just test the x coordinate, I suppose. --- spec/integration/startup-spec.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index d66bcb077..da4e08ae2 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -140,8 +140,11 @@ describe "Starting Atom", -> .execute -> atom.getPosition() .then ({value}) -> win1Position = value .then -> - expect(win0Position.x).toEqual(win1Position.x + 22) - expect(win0Position.y).toEqual(win1Position.y + 22) + expect(win1Position.x).toBeGreaterThan(win0Position.x) + # Ideally we'd test the y coordinate too, but if the window's + # already as tall as it can be, then OS X won't move it down outside + # the screen. + # expect(win1Position.y).toBeGreaterThan(win0Position.y) describe "reopening a directory that was previously opened", -> it "remembers the state of the window", -> From 3b8375d2b4163261e119481d0b5b63acdc07d727 Mon Sep 17 00:00:00 2001 From: Valerii Iatsko Date: Wed, 6 Jan 2016 00:05:58 +0100 Subject: [PATCH 51/91] This change gives custom repositoryProviders more priority - this wil allow us to override base git repository implementation --- src/project.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/project.coffee b/src/project.coffee index d59c041cb..714511f9a 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -288,7 +288,7 @@ class Project extends Model 'atom.repository-provider', '^0.1.0', (provider) => - @repositoryProviders.push(provider) + @repositoryProviders.unshift(provider) @setPaths(@getPaths()) if null in @repositories new Disposable => @repositoryProviders.splice(@repositoryProviders.indexOf(provider), 1) From 972d62f9d2fffd8d32d7ad01bc2a73c4cfab6599 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 5 Jan 2016 17:23:32 -0800 Subject: [PATCH 52/91] :arrow_up: text-buffer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 591e1a2a0..d6eefcc7c 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "service-hub": "^0.7.0", "source-map-support": "^0.3.2", "temp": "0.8.1", - "text-buffer": "8.1.3", + "text-buffer": "8.1.4", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" From 9efb3328bc0b252fc792f687377eb5d4b0f018a9 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Wed, 6 Jan 2016 18:20:46 -0800 Subject: [PATCH 53/91] Add helper to map error codes to friendly messages --- src/pane.coffee | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/pane.coffee b/src/pane.coffee index 412fc5251..c494297cf 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -721,30 +721,27 @@ class Pane extends Model message = "#{message} '#{itemPath}'" if itemPath @notificationManager.addWarning(message, options) - if error.code is 'EISDIR' or error.message?.endsWith?('is a directory') + customMessage = @getMessageForErrorCode(error.code) + if customMessage? + addWarningWithPath("Unable to save file: #{customMessage}") + else if error.code is 'EISDIR' or error.message?.endsWith?('is a directory') @notificationManager.addWarning("Unable to save file: #{error.message}") - else if error.code is 'EACCES' - addWarningWithPath('Unable to save file: Permission denied') else if error.code in ['EPERM', 'EBUSY', 'UNKNOWN', 'EEXIST', 'ELOOP', 'EAGAIN'] addWarningWithPath('Unable to save file', detail: error.message) - else if error.code is 'EROFS' - addWarningWithPath('Unable to save file: Read-only file system') - else if error.code is 'ENOSPC' - addWarningWithPath('Unable to save file: No space left on device') - else if error.code is 'ENXIO' - addWarningWithPath('Unable to save file: No such device or address') - else if error.code is 'ENOTSUP' - addWarningWithPath('Unable to save file: Operation not supported on socket') - else if error.code is 'EIO' - addWarningWithPath('Unable to save file: I/O error writing file') - else if error.code is 'EINTR' - addWarningWithPath('Unable to save file: Interrupted system call') - else if error.code is 'ECONNRESET' - addWarningWithPath('Unable to save file: Connection reset') - else if error.code is 'ESPIPE' - addWarningWithPath('Unable to save file: Invalid seek') else if errorMatch = /ENOTDIR, not a directory '([^']+)'/.exec(error.message) fileName = errorMatch[1] @notificationManager.addWarning("Unable to save file: A directory in the path '#{fileName}' could not be written to") else throw error + + getMessageForErrorCode: (errorCode) -> + switch errorCode + when 'EACCES' then 'Permission denied' + when 'ECONNRESET' then 'Connection reset' + when 'EINTR' then 'Interrupted system call' + when 'EIO' then 'I/O error writing file' + when 'ENOSPC' then 'No space left on device' + when 'ENOTSUP' then 'Operation not supported on socket' + when 'ENXIO' then 'No such device or address' + when 'EROFS' then 'Read-only file system' + when 'ESPIPE' then 'Invalid seek' From 3bcb062ab0d8c6b9992dbcbee856e46608a0dbc1 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Wed, 6 Jan 2016 18:23:25 -0800 Subject: [PATCH 54/91] Add friendly message for ETIMEDOUT --- src/pane.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pane.coffee b/src/pane.coffee index c494297cf..c006e29fe 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -745,3 +745,4 @@ class Pane extends Model when 'ENXIO' then 'No such device or address' when 'EROFS' then 'Read-only file system' when 'ESPIPE' then 'Invalid seek' + when 'ETIMEDOUT' then 'Connection timed out' From 41c8792a7d19b7cd4fbceb4cc7e4e1d99c51363a Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Wed, 6 Jan 2016 18:27:18 -0800 Subject: [PATCH 55/91] Handle EAGAIN errors on open --- src/workspace.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index f64f58ee0..07e69cdcf 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -475,7 +475,7 @@ class Workspace extends Model when 'EACCES' @notificationManager.addWarning("Permission denied '#{error.path}'") return Promise.resolve() - when 'EPERM', 'EBUSY', 'ENXIO', 'EIO', 'ENOTCONN', 'UNKNOWN', 'ECONNRESET', 'EINVAL', 'EMFILE', 'ENOTDIR' + when 'EPERM', 'EBUSY', 'ENXIO', 'EIO', 'ENOTCONN', 'UNKNOWN', 'ECONNRESET', 'EINVAL', 'EMFILE', 'ENOTDIR', 'EAGAIN' @notificationManager.addWarning("Unable to open '#{error.path ? uri}'", detail: error.message) return Promise.resolve() else From ee564845d6ae36418a79b9c29354b5b61ae4f2e3 Mon Sep 17 00:00:00 2001 From: Lee DohM Date: Thu, 7 Jan 2016 14:19:27 -0800 Subject: [PATCH 56/91] Default to using standard GitHub API token during build --- build/Gruntfile.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index f210ccff0..60d5916b8 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -256,7 +256,7 @@ module.exports = (grunt) -> outputDir: 'electron' downloadDir: electronDownloadDir rebuild: true # rebuild native modules after electron is updated - token: process.env.ATOM_ACCESS_TOKEN + token: process.env.ATOM_ACCESS_TOKEN ? 'da809a6077bb1b0aa7c5623f7b2d5f1fec2faae4' 'create-windows-installer': installer: From 26a2fe0f442c9f9d454b0dad8f1caa7126f483ba Mon Sep 17 00:00:00 2001 From: simurai Date: Fri, 8 Jan 2016 09:22:02 +0900 Subject: [PATCH 57/91] :arrow_up: one-dark/light-syntax@v1.1.2 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d6eefcc7c..bef892234 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,8 @@ "base16-tomorrow-dark-theme": "1.1.0", "base16-tomorrow-light-theme": "1.1.1", "one-dark-ui": "1.1.9", - "one-dark-syntax": "1.1.1", - "one-light-syntax": "1.1.1", + "one-dark-syntax": "1.1.2", + "one-light-syntax": "1.1.2", "one-light-ui": "1.1.9", "solarized-dark-syntax": "0.39.0", "solarized-light-syntax": "0.23.0", From 9e8507f2b673070b377859bb43be910cc67f2a98 Mon Sep 17 00:00:00 2001 From: simurai Date: Fri, 8 Jan 2016 09:24:08 +0900 Subject: [PATCH 58/91] Reorder one-light-ui so it's after one-dark-ui. Handy since they get updated together. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bef892234..eaad0b69a 100644 --- a/package.json +++ b/package.json @@ -65,9 +65,9 @@ "base16-tomorrow-dark-theme": "1.1.0", "base16-tomorrow-light-theme": "1.1.1", "one-dark-ui": "1.1.9", + "one-light-ui": "1.1.9", "one-dark-syntax": "1.1.2", "one-light-syntax": "1.1.2", - "one-light-ui": "1.1.9", "solarized-dark-syntax": "0.39.0", "solarized-light-syntax": "0.23.0", "about": "1.1.0", From de043956bb2c1812c40033278ed66771ede69783 Mon Sep 17 00:00:00 2001 From: Lee DohM Date: Thu, 7 Jan 2016 18:51:26 -0800 Subject: [PATCH 59/91] Relocate and rename 'View > Reload' to prevent confusion --- menus/darwin.cson | 2 +- menus/linux.cson | 2 +- menus/win32.cson | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/menus/darwin.cson b/menus/darwin.cson index 52b7a5bc8..31a2b8db6 100644 --- a/menus/darwin.cson +++ b/menus/darwin.cson @@ -139,7 +139,6 @@ { label: 'View' submenu: [ - { label: 'Reload', command: 'window:reload' } { label: 'Toggle Full Screen', command: 'window:toggle-full-screen' } { label: 'Panes' @@ -165,6 +164,7 @@ submenu: [ { label: 'Open In Dev Mode…', command: 'application:open-dev' } { label: 'Run Package Specs', command: 'window:run-package-specs' } + { label: 'Reload Window', command: 'window:reload' } { label: 'Toggle Developer Tools', command: 'window:toggle-dev-tools' } ] } diff --git a/menus/linux.cson b/menus/linux.cson index fa831b4a4..8e9b22cc4 100644 --- a/menus/linux.cson +++ b/menus/linux.cson @@ -95,7 +95,6 @@ { label: '&View' submenu: [ - { label: '&Reload', command: 'window:reload' } { label: 'Toggle &Full Screen', command: 'window:toggle-full-screen' } { label: 'Toggle Menu Bar', command: 'window:toggle-menu-bar' } { @@ -122,6 +121,7 @@ submenu: [ { label: 'Open In &Dev Mode…', command: 'application:open-dev' } { label: 'Run Package &Specs', command: 'window:run-package-specs' } + { label: '&Reload Window', command: 'window:reload' } { label: 'Toggle Developer &Tools', command: 'window:toggle-dev-tools' } ] } diff --git a/menus/win32.cson b/menus/win32.cson index 04da3d388..edc6a9c6c 100644 --- a/menus/win32.cson +++ b/menus/win32.cson @@ -94,7 +94,6 @@ { label: '&View' submenu: [ - { label: '&Reload', command: 'window:reload' } { label: 'Toggle &Full Screen', command: 'window:toggle-full-screen' } { label: 'Toggle Menu Bar', command: 'window:toggle-menu-bar' } { @@ -121,6 +120,7 @@ submenu: [ { label: 'Open In &Dev Mode…', command: 'application:open-dev' } { label: 'Run Package &Specs', command: 'window:run-package-specs' } + { label: '&Reload Window', command: 'window:reload' } { label: 'Toggle Developer &Tools', command: 'window:toggle-dev-tools' } ] } From ad76d3396b48a1737e46f5b046d126a653df167a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 26 Nov 2015 16:09:40 +0800 Subject: [PATCH 60/91] :arrow_up: electron@0.34.5 Fix #9584. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1cb27543a..965c2010e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", - "electronVersion": "0.34.3", + "electronVersion": "0.34.5", "dependencies": { "async": "0.2.6", "atom-keymap": "^6.1.1", From e9bb1f9220a07c3e723d6c801ca80265e4f92fa7 Mon Sep 17 00:00:00 2001 From: Lee DohM Date: Thu, 7 Jan 2016 19:31:03 -0800 Subject: [PATCH 61/91] Sort alphabetically --- menus/darwin.cson | 2 +- menus/linux.cson | 2 +- menus/win32.cson | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/menus/darwin.cson b/menus/darwin.cson index 31a2b8db6..0195bde71 100644 --- a/menus/darwin.cson +++ b/menus/darwin.cson @@ -163,8 +163,8 @@ label: 'Developer' submenu: [ { label: 'Open In Dev Mode…', command: 'application:open-dev' } - { label: 'Run Package Specs', command: 'window:run-package-specs' } { label: 'Reload Window', command: 'window:reload' } + { label: 'Run Package Specs', command: 'window:run-package-specs' } { label: 'Toggle Developer Tools', command: 'window:toggle-dev-tools' } ] } diff --git a/menus/linux.cson b/menus/linux.cson index 8e9b22cc4..9f251d67f 100644 --- a/menus/linux.cson +++ b/menus/linux.cson @@ -120,8 +120,8 @@ label: 'Developer' submenu: [ { label: 'Open In &Dev Mode…', command: 'application:open-dev' } - { label: 'Run Package &Specs', command: 'window:run-package-specs' } { label: '&Reload Window', command: 'window:reload' } + { label: 'Run Package &Specs', command: 'window:run-package-specs' } { label: 'Toggle Developer &Tools', command: 'window:toggle-dev-tools' } ] } diff --git a/menus/win32.cson b/menus/win32.cson index edc6a9c6c..ad0461898 100644 --- a/menus/win32.cson +++ b/menus/win32.cson @@ -119,8 +119,8 @@ label: 'Developer' submenu: [ { label: 'Open In &Dev Mode…', command: 'application:open-dev' } - { label: 'Run Package &Specs', command: 'window:run-package-specs' } { label: '&Reload Window', command: 'window:reload' } + { label: 'Run Package &Specs', command: 'window:run-package-specs' } { label: 'Toggle Developer &Tools', command: 'window:toggle-dev-tools' } ] } From 8f1c49cb5c7a79156b634d5d6a19523b56f5f5c9 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 20 Nov 2015 16:55:38 -0800 Subject: [PATCH 62/91] Merge pull request #9636 from DouweM/unique-title Use unique text editor title in window and tab titles --- .../sample-theme-2/src/js/plugin/main.js | 0 spec/text-editor-spec.coffee | 23 +++++-- spec/workspace-spec.coffee | 6 +- src/text-editor.coffee | 66 +++++++++++-------- src/workspace.coffee | 2 +- 5 files changed, 58 insertions(+), 39 deletions(-) create mode 100644 spec/fixtures/testdir/sample-theme-2/src/js/plugin/main.js diff --git a/spec/fixtures/testdir/sample-theme-2/src/js/plugin/main.js b/spec/fixtures/testdir/sample-theme-2/src/js/plugin/main.js new file mode 100644 index 000000000..e69de29bb diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index 39740ebd2..0cee8215a 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -168,7 +168,7 @@ describe "TextEditor", -> buffer.setPath(undefined) expect(editor.getLongTitle()).toBe 'untitled' - it "returns / when opened files has identical file names", -> + it "returns '' when opened files have identical file names", -> editor1 = null editor2 = null waitsForPromise -> @@ -177,10 +177,10 @@ describe "TextEditor", -> atom.workspace.open(path.join('sample-theme-2', 'readme')).then (o) -> editor2 = o runs -> - expect(editor1.getLongTitle()).toBe 'sample-theme-1/readme' - expect(editor2.getLongTitle()).toBe 'sample-theme-2/readme' + expect(editor1.getLongTitle()).toBe "readme \u2014 sample-theme-1" + expect(editor2.getLongTitle()).toBe "readme \u2014 sample-theme-2" - it "or returns /.../ when opened files has identical file names", -> + it "returns '' when opened files have identical file and dir names", -> editor1 = null editor2 = null waitsForPromise -> @@ -189,9 +189,20 @@ describe "TextEditor", -> atom.workspace.open(path.join('sample-theme-2', 'src', 'js', 'main.js')).then (o) -> editor2 = o runs -> - expect(editor1.getLongTitle()).toBe 'sample-theme-1/.../main.js' - expect(editor2.getLongTitle()).toBe 'sample-theme-2/.../main.js' + expect(editor1.getLongTitle()).toBe "main.js \u2014 sample-theme-1/src/js" + expect(editor2.getLongTitle()).toBe "main.js \u2014 sample-theme-2/src/js" + it "returns '' when opened files have identical file and same parent dir name", -> + editor1 = null + editor2 = null + waitsForPromise -> + atom.workspace.open(path.join('sample-theme-2', 'src', 'js', 'main.js')).then (o) -> + editor1 = o + atom.workspace.open(path.join('sample-theme-2', 'src', 'js', 'plugin', 'main.js')).then (o) -> + editor2 = o + runs -> + expect(editor1.getLongTitle()).toBe "main.js \u2014 js" + expect(editor2.getLongTitle()).toBe "main.js \u2014 js/plugin" it "notifies ::onDidChangeTitle observers when the underlying buffer path changes", -> observed = [] diff --git a/spec/workspace-spec.coffee b/spec/workspace-spec.coffee index 5d7343540..71713d83d 100644 --- a/spec/workspace-spec.coffee +++ b/spec/workspace-spec.coffee @@ -76,7 +76,7 @@ describe "Workspace", -> expect(editor4.getCursorScreenPosition()).toEqual [2, 4] expect(atom.workspace.getActiveTextEditor().getPath()).toBe editor3.getPath() - expect(document.title).toBe "#{path.basename(editor3.getPath())} - #{atom.project.getPaths()[0]} - Atom" + expect(document.title).toBe "#{path.basename(editor3.getLongTitle())} - #{atom.project.getPaths()[0]} - Atom" describe "where there are no open panes or editors", -> it "constructs the view with no open editors", -> @@ -776,8 +776,8 @@ describe "Workspace", -> applicationDelegate: atom.applicationDelegate, assert: atom.assert.bind(atom) }) workspace2.deserialize(atom.workspace.serialize(), atom.deserializers) - item = atom.workspace.getActivePaneItem() - expect(document.title).toBe "#{item.getTitle()} - #{atom.project.getPaths()[0]} - Atom" + item = workspace2.getActivePaneItem() + expect(document.title).toBe "#{item.getLongTitle()} - #{atom.project.getPaths()[0]} - Atom" workspace2.destroy() describe "document edited status", -> diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 29d56c6c8..a151c9dba 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -581,10 +581,7 @@ class TextEditor extends Model # # Returns a {String}. getTitle: -> - if sessionPath = @getPath() - path.basename(sessionPath) - else - 'untitled' + @getFileName() ? 'untitled' # Essential: Get unique title for display in other parts of the UI, such as # the window title. @@ -593,41 +590,52 @@ class TextEditor extends Model # If the editor's buffer is saved, its unique title is formatted as one # of the following, # * "" when it is the only editing buffer with this file name. - # * "/.../", where the "..." may be omitted - # if the the direct parent directory is already different. + # * "" when other buffers have this file name. # # Returns a {String} getLongTitle: -> - if sessionPath = @getPath() - title = @getTitle() + if @getPath() + fileName = @getFileName() - # find text editors with identical file name. - paths = [] + allPathSegments = [] for textEditor in atom.workspace.getTextEditors() when textEditor isnt this - if textEditor.getTitle() is title - paths.push(textEditor.getPath()) - if paths.length is 0 - return title - fileName = path.basename(sessionPath) + if textEditor.getFileName() is fileName + allPathSegments.push(textEditor.getDirectoryPath().split(path.sep)) - # find the first directory in all these paths that is unique - nLevel = 0 - while (_.some(paths, (apath) -> path.basename(apath) is path.basename(sessionPath))) - sessionPath = path.dirname(sessionPath) - paths = _.map(paths, (apath) -> path.dirname(apath)) - nLevel += 1 + if allPathSegments.length is 0 + return fileName - directory = path.basename sessionPath - if nLevel > 1 - path.join(directory, "...", fileName) - else - path.join(directory, fileName) + ourPathSegments = @getDirectoryPath().split(path.sep) + allPathSegments.push ourPathSegments + + loop + firstSegment = ourPathSegments[0] + + commonBase = _.all(allPathSegments, (pathSegments) -> pathSegments.length > 1 and pathSegments[0] is firstSegment) + if commonBase + pathSegments.shift() for pathSegments in allPathSegments + else + break + + "#{fileName} \u2014 #{path.join(pathSegments...)}" else 'untitled' # Essential: Returns the {String} path of this editor's text buffer. getPath: -> @buffer.getPath() + getFileName: -> + if fullPath = @getPath() + path.basename(fullPath) + else + null + + getDirectoryPath: -> + if fullPath = @getPath() + path.dirname(fullPath) + else + null + # Extended: Returns the {String} character set encoding of this editor's text # buffer. getEncoding: -> @buffer.getEncoding() @@ -678,16 +686,16 @@ class TextEditor extends Model getSaveDialogOptions: -> {} checkoutHeadRevision: -> - if filePath = this.getPath() + if @getPath() checkoutHead = => - @project.repositoryForDirectory(new Directory(path.dirname(filePath))) + @project.repositoryForDirectory(new Directory(@getDirectoryPath())) .then (repository) => repository?.checkoutHeadForEditor(this) if @config.get('editor.confirmCheckoutHeadRevision') @applicationDelegate.confirm message: 'Confirm Checkout HEAD Revision' - detailedMessage: "Are you sure you want to discard all changes to \"#{path.basename(filePath)}\" since the last Git commit?" + detailedMessage: "Are you sure you want to discard all changes to \"#{@getFileName()}\" since the last Git commit?" buttons: OK: checkoutHead Cancel: null diff --git a/src/workspace.coffee b/src/workspace.coffee index 396008201..6088055d1 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -155,7 +155,7 @@ class Workspace extends Model projectPaths = @project.getPaths() ? [] if item = @getActivePaneItem() itemPath = item.getPath?() - itemTitle = item.getTitle?() + itemTitle = item.getLongTitle?() ? item.getTitle?() projectPath = _.find projectPaths, (projectPath) -> itemPath is projectPath or itemPath?.startsWith(projectPath + path.sep) itemTitle ?= "untitled" From f527504402452aad70210e767abcae37981aa3e2 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 7 Jan 2016 22:49:30 -0500 Subject: [PATCH 63/91] :arrow_up: language-python@0.43.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eaad0b69a..f9d41fc64 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,7 @@ "language-perl": "0.32.0", "language-php": "0.36.0", "language-property-list": "0.8.0", - "language-python": "0.42.1", + "language-python": "0.43.0", "language-ruby": "0.67.0", "language-ruby-on-rails": "0.25.0", "language-sass": "0.45.0", From 0bb8e21c04378f3c46fd0181c136b4136e714746 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 7 Jan 2016 22:49:51 -0500 Subject: [PATCH 64/91] :arrow_up: language-json@0.17.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f9d41fc64..8f8b24b9c 100644 --- a/package.json +++ b/package.json @@ -128,7 +128,7 @@ "language-hyperlink": "0.16.0", "language-java": "0.17.0", "language-javascript": "0.105.0", - "language-json": "0.17.2", + "language-json": "0.17.3", "language-less": "0.29.0", "language-make": "0.21.0", "language-mustache": "0.13.0", From 1a13913168ef7f9fb614003434aa4fdf51b0f157 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Fri, 8 Jan 2016 12:00:24 -0500 Subject: [PATCH 65/91] Use OS X Human Interface Guidelines compliant menu order Fixes https://github.com/atom/atom/issues/10302 --- menus/darwin.cson | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/menus/darwin.cson b/menus/darwin.cson index 0195bde71..23f4b6144 100644 --- a/menus/darwin.cson +++ b/menus/darwin.cson @@ -110,32 +110,6 @@ ] } - { - label: 'Selection' - submenu: [ - { label: 'Add Selection Above', command: 'editor:add-selection-above' } - { label: 'Add Selection Below', command: 'editor:add-selection-below' } - { label: 'Single Selection', command: 'editor:consolidate-selections'} - { label: 'Split into Lines', command: 'editor:split-selections-into-lines'} - { type: 'separator' } - { label: 'Select to Top', command: 'core:select-to-top' } - { label: 'Select to Bottom', command: 'core:select-to-bottom' } - { type: 'separator' } - { label: 'Select Line', command: 'editor:select-line' } - { label: 'Select Word', command: 'editor:select-word' } - { label: 'Select to Beginning of Word', command: 'editor:select-to-beginning-of-word' } - { label: 'Select to Beginning of Line', command: 'editor:select-to-beginning-of-line' } - { label: 'Select to First Character of Line', command: 'editor:select-to-first-character-of-line' } - { label: 'Select to End of Word', command: 'editor:select-to-end-of-word' } - { label: 'Select to End of Line', command: 'editor:select-to-end-of-line' } - ] - } - - { - label: 'Find' - submenu: [] - } - { label: 'View' submenu: [ @@ -177,6 +151,32 @@ ] } + { + label: 'Selection' + submenu: [ + { label: 'Add Selection Above', command: 'editor:add-selection-above' } + { label: 'Add Selection Below', command: 'editor:add-selection-below' } + { label: 'Single Selection', command: 'editor:consolidate-selections'} + { label: 'Split into Lines', command: 'editor:split-selections-into-lines'} + { type: 'separator' } + { label: 'Select to Top', command: 'core:select-to-top' } + { label: 'Select to Bottom', command: 'core:select-to-bottom' } + { type: 'separator' } + { label: 'Select Line', command: 'editor:select-line' } + { label: 'Select Word', command: 'editor:select-word' } + { label: 'Select to Beginning of Word', command: 'editor:select-to-beginning-of-word' } + { label: 'Select to Beginning of Line', command: 'editor:select-to-beginning-of-line' } + { label: 'Select to First Character of Line', command: 'editor:select-to-first-character-of-line' } + { label: 'Select to End of Word', command: 'editor:select-to-end-of-word' } + { label: 'Select to End of Line', command: 'editor:select-to-end-of-line' } + ] + } + + { + label: 'Find' + submenu: [] + } + { label: 'Packages' submenu: [] From 5738b14eda476e90c85aaf67128df5baf7cbff23 Mon Sep 17 00:00:00 2001 From: Katrina Uychaco Date: Fri, 8 Jan 2016 13:39:46 -0800 Subject: [PATCH 66/91] :art: --- spec/text-editor-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index 686bb6868..ce84d2c50 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -5815,7 +5815,7 @@ describe "TextEditor", -> expect(editor1.isPending()).toBe true expect(editor.isPending()).toBe false # By default pending status is false - it "invokes ::onDidTerminatePendingState observers if pending status is removed", -> + it "invokes ::onDidTerminatePendingState observers if pending status is terminated", -> events = [] editor1.onDidTerminatePendingState (event) -> events.push(event) editor1.terminatePendingState() From 235e489f6e357075072a790ae449f431710b3f0f Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 9 Jan 2016 04:20:30 -0800 Subject: [PATCH 67/91] Fix F11 keymaps Function key keymaps don't work when they feature upperface 'F' characters. They still tend to work because they typically have an application menu item which is associated with it and falled back upon. The main difference is that the originalEvent (KeyboardEvent) is not retained when doing this fallback as Atom thinks that the menu item was pressed instead of the keymap. Fixes #10287 --- keymaps/linux.cson | 2 +- keymaps/win32.cson | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keymaps/linux.cson b/keymaps/linux.cson index 28f43a8fc..536a1d75d 100644 --- a/keymaps/linux.cson +++ b/keymaps/linux.cson @@ -13,7 +13,7 @@ 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-shift-pageup': 'pane:move-item-left' 'ctrl-shift-pagedown': 'pane:move-item-right' - 'F11': 'window:toggle-full-screen' + 'f11': 'window:toggle-full-screen' # Sublime Parity 'ctrl-,': 'application:show-settings' diff --git a/keymaps/win32.cson b/keymaps/win32.cson index f052a64fc..cb291f493 100644 --- a/keymaps/win32.cson +++ b/keymaps/win32.cson @@ -19,7 +19,7 @@ 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-shift-left': 'pane:move-item-left' 'ctrl-shift-right': 'pane:move-item-right' - 'F11': 'window:toggle-full-screen' + 'f11': 'window:toggle-full-screen' # Sublime Parity 'ctrl-,': 'application:show-settings' From d4c8770176efe0698dedeab7e943a76fd8eb698f Mon Sep 17 00:00:00 2001 From: Yuya Tanaka Date: Sun, 10 Jan 2016 19:35:34 +0900 Subject: [PATCH 68/91] Add copy project path command to text-editor --- src/register-default-commands.coffee | 3 ++- src/text-editor.coffee | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/register-default-commands.coffee b/src/register-default-commands.coffee index 159ea1abc..b4649f70e 100644 --- a/src/register-default-commands.coffee +++ b/src/register-default-commands.coffee @@ -169,7 +169,8 @@ module.exports = ({commandRegistry, commandInstaller, config}) -> 'editor:fold-at-indent-level-8': -> @foldAllAtIndentLevel(7) 'editor:fold-at-indent-level-9': -> @foldAllAtIndentLevel(8) 'editor:log-cursor-scope': -> @logCursorScope() - 'editor:copy-path': -> @copyPathToClipboard() + 'editor:copy-path': -> @copyPathToClipboard(false) + 'editor:copy-project-path': -> @copyPathToClipboard(true) 'editor:toggle-indent-guide': -> config.set('editor.showIndentGuide', not config.get('editor.showIndentGuide')) 'editor:toggle-line-numbers': -> config.set('editor.showLineNumbers', not config.get('editor.showLineNumbers')) 'editor:scroll-to-cursor': -> @scrollToCursorPosition() diff --git a/src/text-editor.coffee b/src/text-editor.coffee index ae2645567..983669e28 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -666,8 +666,9 @@ class TextEditor extends Model isPending: -> Boolean(@pending) # Copies the current file path to the native clipboard. - copyPathToClipboard: -> + copyPathToClipboard: (relative = false) -> if filePath = @getPath() + filePath = atom.project.relativize(filePath) if relative @clipboard.write(filePath) ### From 6b44562a22f197815f656639b6cb36d36423c030 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Sun, 10 Jan 2016 23:11:41 +0100 Subject: [PATCH 69/91] :arrow_up: language-go@0.42.0 This version fixes #10272 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 965c2010e..9c74d5c9b 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "language-css": "0.35.0", "language-gfm": "0.81.0", "language-git": "0.10.0", - "language-go": "0.40.0", + "language-go": "0.42.0", "language-html": "0.42.0", "language-hyperlink": "0.15.0", "language-java": "0.16.1", From 35f262f4117d6d4cbe33ec336d905781ef79af83 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 10 Jan 2016 20:41:43 -0500 Subject: [PATCH 70/91] :arrow_up: language-html@0.44.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f8b24b9c..76a351866 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "language-gfm": "0.82.0", "language-git": "0.11.0", "language-go": "0.41.0", - "language-html": "0.43.1", + "language-html": "0.44.0", "language-hyperlink": "0.16.0", "language-java": "0.17.0", "language-javascript": "0.105.0", From d48f3aaed8d750b07a8d6c1da582a4309ff2ff0f Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Mon, 11 Jan 2016 10:06:01 -0500 Subject: [PATCH 71/91] :arrow_up: settings-view@0.232.1 refs https://github.com/atom/settings-view/pull/698 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 76a351866..8fd36fd8a 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "open-on-github": "0.40.0", "package-generator": "0.41.0", "release-notes": "0.53.0", - "settings-view": "0.232.1", + "settings-view": "0.232.2", "snippets": "1.0.1", "spell-check": "0.63.0", "status-bar": "0.80.0", From 9e6136470e30842fe57db21eb2819215657d673a Mon Sep 17 00:00:00 2001 From: Josh Abernathy Date: Mon, 11 Jan 2016 12:17:08 -0500 Subject: [PATCH 72/91] :fire: CHANGELOG.md Having this file still here is confusing. Do we use it, or do we use https://github.com/benogle/pr-changelog? Let's apply :fire: if we're not gonna keep it up to date. /cc @mnquintana --- CHANGELOG.md | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e36b3f59e..8823bd9cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,18 +1 @@ See https://atom.io/releases - -## 1.4.0 - -* Switching encoding is now fast also with large files. -* Fixed an issue where disabling and re-enabling a package caused custom keymaps to be overridden. -* Fixed restoring untitled editors on restart. The new behavior never prompts to save new/changed files when closing a window or quitting Atom. - -## 1.3.0 - -* The tree-view now sorts directory entries more naturally, in a locale-sensitive way. -* Lines can now be moved up and down with multiple cursors. -* Improved the performance of marker-dependent code paths such as spell-check and find and replace. -* Fixed copying and pasting in native input fields. -* By default, windows with no pane items are now closed via the `core:close` command. The previous behavior can be restored via the `Close Empty Windows` option in settings. -* Fixed an issue where characters were inserted when toggling the settings view on some keyboard layouts. -* Modules can now temporarily override `Error.prepareStackTrace`. There is also an `Error.prototype.getRawStack()` method if you just need access to the raw v8 trace structure. -* Fixed a problem that caused blurry fonts on monitors that have a slightly higher resolution than 96 DPI. From ff0a62833f3302a1656b89686c25a28532f1fa6f Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 11 Jan 2016 11:26:31 -0700 Subject: [PATCH 73/91] Pin jQuery to 2.1.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8fd36fd8a..06f4d2bfe 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "grim": "1.5.0", "jasmine-json": "~0.0", "jasmine-tagged": "^1.1.4", - "jquery": "^2.1.1", + "jquery": "2.1.4", "key-path-helpers": "^0.4.0", "less-cache": "0.22", "marked": "^0.3.4", From 339489997b7fbecfd9ea6340f0f0d2de7768daf5 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 11 Jan 2016 11:31:31 -0700 Subject: [PATCH 74/91] :arrow_up: tree-view --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 06f4d2bfe..e3a4637a7 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "symbols-view": "0.110.1", "tabs": "0.88.0", "timecop": "0.33.0", - "tree-view": "0.198.0", + "tree-view": "0.198.1", "update-package-dependencies": "0.10.0", "welcome": "0.33.0", "whitespace": "0.32.1", From 2acb9c1ee885f0b47cc8e87085bf3c44748acf69 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 11 Jan 2016 11:31:38 -0700 Subject: [PATCH 75/91] :arrow_up: settings-view --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e3a4637a7..d781d82ac 100644 --- a/package.json +++ b/package.json @@ -103,7 +103,7 @@ "open-on-github": "0.40.0", "package-generator": "0.41.0", "release-notes": "0.53.0", - "settings-view": "0.232.2", + "settings-view": "0.232.3", "snippets": "1.0.1", "spell-check": "0.63.0", "status-bar": "0.80.0", From e7f15d06e4632eeee2d51cf827921a1c0a058b28 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Sun, 10 Jan 2016 09:32:51 -0500 Subject: [PATCH 76/91] :white_check_mark: Add failing spec for disabling an already disabled package --- spec/package-manager-spec.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/package-manager-spec.coffee b/spec/package-manager-spec.coffee index e6848ef03..3099684b1 100644 --- a/spec/package-manager-spec.coffee +++ b/spec/package-manager-spec.coffee @@ -1026,6 +1026,16 @@ describe "PackageManager", -> expect(atom.packages.enablePackage("this-doesnt-exist")).toBeNull() expect(console.warn.callCount).toBe 1 + fit "does not disable an already disabled package", -> + packageName = 'package-with-main' + atom.config.pushAtKeyPath('core.disabledPackages', packageName) + atom.packages.observeDisabledPackages() + expect(atom.config.get('core.disabledPackages')).toContain packageName + + atom.packages.disablePackage(packageName) + packagesDisabled = atom.config.get('core.disabledPackages').filter((pack) -> pack is packageName) + expect(packagesDisabled.length).toEqual 1 + describe "with themes", -> didChangeActiveThemesHandler = null From 78543a7a34d0197576849de26217f7dccf895d6b Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Sun, 10 Jan 2016 09:38:12 -0500 Subject: [PATCH 77/91] Only disable a package if it isn't already disabled --- src/package-manager.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 6772178af..1ecdc5448 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -199,7 +199,10 @@ class PackageManager # Returns the {Package} that was disabled or null if it isn't loaded. disablePackage: (name) -> pack = @loadPackage(name) - pack?.disable() + + unless @isPackageDisabled(name) + pack?.disable() + pack # Public: Is the package with the given name disabled? From 088b32f9d5f583724391bb748d2a5f294f3d9d13 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Sun, 10 Jan 2016 09:39:09 -0500 Subject: [PATCH 78/91] Unfocus spec --- spec/package-manager-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/package-manager-spec.coffee b/spec/package-manager-spec.coffee index 3099684b1..46d1d11ee 100644 --- a/spec/package-manager-spec.coffee +++ b/spec/package-manager-spec.coffee @@ -1026,7 +1026,7 @@ describe "PackageManager", -> expect(atom.packages.enablePackage("this-doesnt-exist")).toBeNull() expect(console.warn.callCount).toBe 1 - fit "does not disable an already disabled package", -> + it "does not disable an already disabled package", -> packageName = 'package-with-main' atom.config.pushAtKeyPath('core.disabledPackages', packageName) atom.packages.observeDisabledPackages() From 731e782f0de5c91d4a42ba530c8cf6d020e24161 Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 11 Jan 2016 16:08:07 -0500 Subject: [PATCH 79/91] RIP release-notes. --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index d781d82ac..5540a3e86 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,6 @@ "notifications": "0.62.1", "open-on-github": "0.40.0", "package-generator": "0.41.0", - "release-notes": "0.53.0", "settings-view": "0.232.3", "snippets": "1.0.1", "spell-check": "0.63.0", From 378f6aaabbe7220aff0a5864fb8e9c4e4b510de1 Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 11 Jan 2016 16:08:24 -0500 Subject: [PATCH 80/91] :arrow_up: about@1.2.0. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5540a3e86..cfb6fa2c0 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "one-light-syntax": "1.1.2", "solarized-dark-syntax": "0.39.0", "solarized-light-syntax": "0.23.0", - "about": "1.1.0", + "about": "1.2.0", "archive-view": "0.61.0", "autocomplete-atom-api": "0.9.2", "autocomplete-css": "0.11.0", From ced74029f8442554397f274a95783af60b812907 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 11 Jan 2016 16:25:57 -0500 Subject: [PATCH 81/91] :arrow_up: language-ruby@0.67.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d781d82ac..de0275f10 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "language-php": "0.36.0", "language-property-list": "0.8.0", "language-python": "0.43.0", - "language-ruby": "0.67.0", + "language-ruby": "0.67.1", "language-ruby-on-rails": "0.25.0", "language-sass": "0.45.0", "language-shellscript": "0.21.0", From b01e97be59a019a384471a08bbf6b8dc98aff275 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 11 Jan 2016 14:01:55 -0800 Subject: [PATCH 82/91] Explicitly guard against decorating destroyed markers Signed-off-by: Nathan Sobo --- spec/display-buffer-spec.coffee | 7 +++++++ src/display-buffer.coffee | 1 + 2 files changed, 8 insertions(+) diff --git a/spec/display-buffer-spec.coffee b/spec/display-buffer-spec.coffee index 8c4adca44..0246008a4 100644 --- a/spec/display-buffer-spec.coffee +++ b/spec/display-buffer-spec.coffee @@ -1253,6 +1253,13 @@ describe "DisplayBuffer", -> decoration.destroy() expect(displayBuffer.decorationForId(decoration.id)).not.toBeDefined() + it "does not allow destroyed markers to be decorated", -> + marker.destroy() + expect(-> + displayBuffer.decorateMarker(marker, {type: 'overlay', item: document.createElement('div')}) + ).toThrow("Cannot decorate a destroyed marker") + expect(displayBuffer.getOverlayDecorations()).toEqual [] + describe "when a decoration is updated via Decoration::update()", -> it "emits an 'updated' event containing the new and old params", -> decoration.onDidChangeProperties updatedSpy = jasmine.createSpy() diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index f5a7bd853..8b95656f9 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -812,6 +812,7 @@ class DisplayBuffer extends Model decorationsState decorateMarker: (marker, decorationParams) -> + throw new Error("Cannot decorate a destroyed marker") if marker.isDestroyed() marker = @getMarkerLayer(marker.layer.id).getMarker(marker.id) decoration = new Decoration(marker, this, decorationParams) @decorationsByMarkerId[marker.id] ?= [] From eaab862e64b143d11de4be3490aee11cc64ee470 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 11 Jan 2016 15:39:53 -0800 Subject: [PATCH 83/91] :arrow_up: spell-check --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index de0275f10..e3ac314bb 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "release-notes": "0.53.0", "settings-view": "0.232.3", "snippets": "1.0.1", - "spell-check": "0.63.0", + "spell-check": "0.64.0", "status-bar": "0.80.0", "styleguide": "0.45.0", "symbols-view": "0.110.1", From 389d3d6760c5f76d50cf316bf91eecd5ad2be57a Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 11 Jan 2016 15:49:13 -0800 Subject: [PATCH 84/91] :arrow_up: spell-check --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e3ac314bb..6ac1c9dce 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "release-notes": "0.53.0", "settings-view": "0.232.3", "snippets": "1.0.1", - "spell-check": "0.64.0", + "spell-check": "0.65.0", "status-bar": "0.80.0", "styleguide": "0.45.0", "symbols-view": "0.110.1", From 53950f6687ca9e0babf9d9c22e46badd8589c3e7 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Tue, 12 Jan 2016 10:14:40 -0500 Subject: [PATCH 85/91] :arrow_up: language-ruby@0.68.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ac1c9dce..08e5e0171 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "language-php": "0.36.0", "language-property-list": "0.8.0", "language-python": "0.43.0", - "language-ruby": "0.67.1", + "language-ruby": "0.68.0", "language-ruby-on-rails": "0.25.0", "language-sass": "0.45.0", "language-shellscript": "0.21.0", From bc69e1624b2551d805083fcb86de8c6b08714b50 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 12 Jan 2016 15:41:26 -0800 Subject: [PATCH 86/91] Don't rely on compile cache in babel compilation specs --- spec/babel-spec.coffee | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/babel-spec.coffee b/spec/babel-spec.coffee index caaaed9f2..e913a7939 100644 --- a/spec/babel-spec.coffee +++ b/spec/babel-spec.coffee @@ -1,4 +1,21 @@ +path = require('path') +temp = require('temp').track() +CompileCache = require('../src/compile-cache') + describe "Babel transpiler support", -> + originalCacheDir = null + + beforeEach -> + originalCacheDir = CompileCache.getCacheDirectory() + CompileCache.setCacheDirectory(temp.mkdirSync('compile-cache')) + for cacheKey in Object.keys(require.cache) + if cacheKey.startsWith(path.join(__dirname, 'fixtures', 'babel')) + console.log('deleting', cacheKey) + delete require.cache[cacheKey] + + afterEach -> + CompileCache.setCacheDirectory(originalCacheDir) + describe 'when a .js file starts with /** @babel */;', -> it "transpiles it using babel", -> transpiled = require('./fixtures/babel/babel-comment.js') From 680e123f880368bf91d8c0b3c85e79348de33b58 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 12 Jan 2016 15:42:44 -0800 Subject: [PATCH 87/91] Prevent babel from logging to stderr --- spec/babel-spec.coffee | 14 ++++++++++++++ src/babel.js | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/spec/babel-spec.coffee b/spec/babel-spec.coffee index e913a7939..3c4a4fe4b 100644 --- a/spec/babel-spec.coffee +++ b/spec/babel-spec.coffee @@ -1,3 +1,8 @@ +# Users may have this environment variable set. Currently, it causes babel to +# log to stderr, which causes errors on Windows. +# See https://github.com/atom/electron/issues/2033 +process.env.DEBUG='*' + path = require('path') temp = require('temp').track() CompileCache = require('../src/compile-cache') @@ -34,3 +39,12 @@ describe "Babel transpiler support", -> describe "when a .js file does not start with 'use babel';", -> it "does not transpile it using babel", -> expect(-> require('./fixtures/babel/invalid.js')).toThrow() + + it "does not try to log to stdout or stderr while parsing the file", -> + spyOn(process.stderr, 'write') + spyOn(process.stdout, 'write') + + transpiled = require('./fixtures/babel/babel-double-quotes.js') + + expect(process.stdout.write).not.toHaveBeenCalled() + expect(process.stderr.write).not.toHaveBeenCalled() diff --git a/src/babel.js b/src/babel.js index f53dbc758..1f450ff96 100644 --- a/src/babel.js +++ b/src/babel.js @@ -42,6 +42,10 @@ exports.getCachePath = function (sourceCode) { exports.compile = function (sourceCode, filePath) { if (!babel) { babel = require('babel-core') + var Logger = require('babel-core/lib/transformation/file/logger') + var noop = function () {} + Logger.prototype.debug = noop + Logger.prototype.verbose = noop } var options = {filename: filePath} From beb1456f69f2b52df84c012e2f8dacf1a35943ba Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 13 Jan 2016 13:30:03 -0500 Subject: [PATCH 88/91] :arrow_up: about@1.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index af0940ead..98b98b8c4 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "one-light-syntax": "1.1.2", "solarized-dark-syntax": "0.39.0", "solarized-light-syntax": "0.23.0", - "about": "1.2.0", + "about": "1.3.0", "archive-view": "0.61.0", "autocomplete-atom-api": "0.9.2", "autocomplete-css": "0.11.0", From d229fed7e73c0f89631ed3b6c2cf16497d0ccbab Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 13 Jan 2016 15:11:55 -0500 Subject: [PATCH 89/91] Merge pull request #10377 from atom/remove-release-notes Remove release-notes --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 93632da54..eee53b978 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "one-light-ui": "1.1.8", "solarized-dark-syntax": "0.39.0", "solarized-light-syntax": "0.23.0", - "about": "1.1.0", + "about": "1.3.0", "archive-view": "0.61.0", "autocomplete-atom-api": "0.9.2", "autocomplete-css": "0.11.0", @@ -102,7 +102,6 @@ "notifications": "0.62.1", "open-on-github": "0.40.0", "package-generator": "0.41.0", - "release-notes": "0.53.0", "settings-view": "0.232.1", "snippets": "1.0.1", "spell-check": "0.63.0", From 6b48c9d8ecf5bac3e47d38af43edd70b9b5a04ff Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 13 Jan 2016 16:29:24 -0500 Subject: [PATCH 90/91] 1.6.0-dev --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bb973f94d..ac5a90b78 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.5.0-dev", + "version": "1.6.0-dev", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From de44221087081d640e7096ffe8992cd90aa22016 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 13 Jan 2016 17:56:46 -0800 Subject: [PATCH 91/91] :arrow_up: language-gfm@0.83 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ac5a90b78..0b2645d4a 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "language-coffee-script": "0.46.0", "language-csharp": "0.11.0", "language-css": "0.36.0", - "language-gfm": "0.82.0", + "language-gfm": "0.83.0", "language-git": "0.11.0", "language-go": "0.42.0", "language-html": "0.44.0",