diff --git a/package.json b/package.json index db13e1f14..6c0cd4254 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "image-view": "0.55.0", "incompatible-packages": "0.25.0", "keybinding-resolver": "0.33.0", - "line-ending-selector": "0.0.5", + "line-ending-selector": "0.1.0", "link": "0.31.0", "markdown-preview": "0.155.0", "metrics": "0.52.0", diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index d63ee4e78..e63e3a766 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -67,6 +67,8 @@ class AtomApplication constructor: (options) -> {@resourcePath, @devResourcePath, @version, @devMode, @safeMode, @socketPath, timeout} = options + @socketPath = null if options.test + global.atomApplication = this @pidsToOpenWindows = {} @@ -132,6 +134,7 @@ class AtomApplication # the other launches will just pass their information to this server and then # close immediately. listenForArgumentsFromNewProcess: -> + return unless @socketPath? @deleteSocketFile() server = net.createServer (connection) => connection.on 'data', (data) => @@ -141,7 +144,7 @@ class AtomApplication server.on 'error', (error) -> console.error 'Application server failed', error deleteSocketFile: -> - return if process.platform is 'win32' + return if process.platform is 'win32' or not @socketPath? if fs.existsSync(@socketPath) try diff --git a/src/coffee-script.js b/src/coffee-script.js index 90f23bfa5..967d07cdd 100644 --- a/src/coffee-script.js +++ b/src/coffee-script.js @@ -29,6 +29,10 @@ exports.compile = function (sourceCode, filePath) { Error.prepareStackTrace = previousPrepareStackTrace } + if (process.platform === 'win32') { + filePath = 'file:///' + path.resolve(filePath).replace(/\\/g, '/') + } + var output = CoffeeScript.compile(sourceCode, { filename: filePath, sourceFiles: [filePath], diff --git a/src/notification-manager.coffee b/src/notification-manager.coffee index 8f790e0c6..46c781c20 100644 --- a/src/notification-manager.coffee +++ b/src/notification-manager.coffee @@ -29,40 +29,65 @@ class NotificationManager # Public: Add a success notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'check'`. addSuccess: (message, options) -> @addNotification(new Notification('success', message, options)) # Public: Add an informational notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'info'`. addInfo: (message, options) -> @addNotification(new Notification('info', message, options)) # Public: Add a warning notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'alert'`. addWarning: (message, options) -> @addNotification(new Notification('warning', message, options)) # Public: Add an error notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'flame'`. addError: (message, options) -> @addNotification(new Notification('error', message, options)) # Public: Add a fatal error notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'bug'`. addFatalError: (message, options) -> @addNotification(new Notification('fatal', message, options)) diff --git a/src/window-event-handler.coffee b/src/window-event-handler.coffee index f4b844405..bec5bc6cb 100644 --- a/src/window-event-handler.coffee +++ b/src/window-event-handler.coffee @@ -10,10 +10,10 @@ class WindowEventHandler @reloadRequested = false @subscriptions = new CompositeDisposable + @previousOnbeforeunloadHandler = window.onbeforeunload + window.onbeforeunload = @handleWindowBeforeunload @addEventListener(window, 'focus', @handleWindowFocus) @addEventListener(window, 'blur', @handleWindowBlur) - @addEventListener(window, 'beforeunload', @handleWindowBeforeunload) - @addEventListener(window, 'unload', @handleWindowUnload) @addEventListener(document, 'keydown', @handleDocumentKeydown) @addEventListener(document, 'drop', @handleDocumentDrop) @@ -54,6 +54,7 @@ class WindowEventHandler bindCommandToAction('core:cut', 'cut') unsubscribe: -> + window.onbeforeunload = @previousOnbeforeunloadHandler @subscriptions.dispose() on: (target, eventName, handler) -> diff --git a/src/workspace.coffee b/src/workspace.coffee index 0a66c226a..0970fa686 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -850,13 +850,14 @@ class Workspace extends Model Section: Searching and Replacing ### - # Public: Performs a search across all the files in the workspace. + # Public: Performs a search across all files in the workspace. # # * `regex` {RegExp} to search with. - # * `options` (optional) {Object} (default: {}) - # * `paths` An {Array} of glob patterns to search within - # * `onPathsSearched` (optional) {Function} - # * `iterator` {Function} callback on each file found + # * `options` (optional) {Object} + # * `paths` An {Array} of glob patterns to search within. + # * `onPathsSearched` (optional) {Function} to be periodically called + # with number of paths searched. + # * `iterator` {Function} callback on each file found. # # Returns a `Promise` with a `cancel()` method that will cancel all # of the underlying searches that were started as part of this scan. @@ -956,10 +957,10 @@ class Workspace extends Model # Public: Performs a replace across all the specified files in the project. # # * `regex` A {RegExp} to search with. - # * `replacementText` Text to replace all matches of regex with - # * `filePaths` List of file path strings to run the replace on. + # * `replacementText` {String} to replace all matches of regex with. + # * `filePaths` An {Array} of file path strings to run the replace on. # * `iterator` A {Function} callback on each file with replacements: - # * `options` {Object} with keys `filePath` and `replacements` + # * `options` {Object} with keys `filePath` and `replacements`. # # Returns a `Promise`. replace: (regex, replacementText, filePaths, iterator) ->