mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Merge branch 'master' into ns-alternative-test-env
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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],
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
@@ -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) ->
|
||||
|
||||
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user