diff --git a/build/tasks/build-task.coffee b/build/tasks/build-task.coffee index be72d52c1..d69e46efc 100644 --- a/build/tasks/build-task.coffee +++ b/build/tasks/build-task.coffee @@ -176,11 +176,8 @@ module.exports = (grunt) -> cp path.join('resources', 'mac', 'speakeasy.pem'), path.resolve(appDir, '..', 'speakeasy.pem') if process.platform is 'win32' - cp path.join('resources', 'win', 'atom.cmd'), path.join(shellAppDir, 'resources', 'cli', 'atom.cmd') - cp path.join('resources', 'win', 'atom.sh'), path.join(shellAppDir, 'resources', 'cli', 'atom.sh') - cp path.join('resources', 'win', 'atom.js'), path.join(shellAppDir, 'resources', 'cli', 'atom.js') - cp path.join('resources', 'win', 'apm.cmd'), path.join(shellAppDir, 'resources', 'cli', 'apm.cmd') - cp path.join('resources', 'win', 'apm.sh'), path.join(shellAppDir, 'resources', 'cli', 'apm.sh') + [ 'atom.cmd', 'atom.sh', 'atom.js', 'apm.cmd', 'apm.sh', 'file.ico' ] + .forEach (file) -> cp path.join('resources', 'win', file), path.join(shellAppDir, 'resources', 'cli', file) if process.platform is 'linux' cp path.join('resources', 'app-icons', channel, 'png'), path.join(buildDir, 'icons') diff --git a/circle.yml b/circle.yml index 36d9962c1..b2b7143e6 100644 --- a/circle.yml +++ b/circle.yml @@ -40,3 +40,9 @@ test: post: - zip -r out/Atom.zip out/Atom.app + +experimental: + notify: + branches: + only: + - master diff --git a/exports/atom.js b/exports/atom.js index 50c8c687f..7bb7cdb1e 100644 --- a/exports/atom.js +++ b/exports/atom.js @@ -27,7 +27,12 @@ const atomExport = { // Shell integration is required by both Squirrel and Settings-View if (process.platform === 'win32') { - atomExport.WinShell = require('../src/main-process/win-shell') + Object.defineProperty(atomExport, 'WinShell', { + enumerable: true, + get () { + return require('../src/main-process/win-shell') + } + }) } // The following classes can't be used from a Task handler and should therefore diff --git a/package.json b/package.json index e4cb76446..a0a27dbdd 100644 --- a/package.json +++ b/package.json @@ -69,15 +69,15 @@ "atom-dark-ui": "0.52.0", "atom-light-syntax": "0.28.0", "atom-light-ui": "0.44.0", - "base16-tomorrow-dark-theme": "1.1.0", - "base16-tomorrow-light-theme": "1.1.1", + "base16-tomorrow-dark-theme": "1.2.0", + "base16-tomorrow-light-theme": "1.2.0", "one-dark-ui": "1.5.0", "one-light-ui": "1.5.0", "one-dark-syntax": "1.3.0", "one-light-syntax": "1.3.0", "solarized-dark-syntax": "1.0.2", "solarized-light-syntax": "1.0.2", - "about": "1.6.0", + "about": "1.7.0", "archive-view": "0.61.1", "autocomplete-atom-api": "0.10.0", "autocomplete-css": "0.11.2", @@ -87,13 +87,13 @@ "autoflow": "0.27.0", "autosave": "0.23.1", "background-tips": "0.26.1", - "bookmarks": "0.41.1", + "bookmarks": "0.42.0", "bracket-matcher": "0.82.1", "command-palette": "0.38.0", "deprecation-cop": "0.54.1", "dev-live-reload": "0.47.0", "encoding-selector": "0.22.0", - "exception-reporting": "0.39.0", + "exception-reporting": "0.40.0", "find-and-replace": "0.201.1", "fuzzy-finder": "1.4.0", "git-diff": "1.1.0", @@ -105,11 +105,11 @@ "line-ending-selector": "0.5.0", "link": "0.31.1", "markdown-preview": "0.158.0", - "metrics": "0.53.1", - "notifications": "0.65.0", + "metrics": "1.0.0", + "notifications": "0.65.1", "open-on-github": "1.2.0", "package-generator": "1.0.0", - "settings-view": "0.241.2", + "settings-view": "0.242.0", "snippets": "1.0.2", "spell-check": "0.68.2", "status-bar": "1.4.1", @@ -117,9 +117,9 @@ "symbols-view": "0.113.1", "tabs": "0.101.0", "timecop": "0.33.2", - "tree-view": "0.209.0", + "tree-view": "0.209.2", "update-package-dependencies": "0.10.0", - "welcome": "0.34.0", + "welcome": "0.35.1", "whitespace": "0.33.0", "wrap-guide": "0.38.2", "language-c": "0.53.0", diff --git a/resources/win/file.ico b/resources/win/file.ico new file mode 100644 index 000000000..138b2ba7c Binary files /dev/null and b/resources/win/file.ico differ diff --git a/spec/context-menu-manager-spec.coffee b/spec/context-menu-manager-spec.coffee index b336361f8..c39f33cea 100644 --- a/spec/context-menu-manager-spec.coffee +++ b/spec/context-menu-manager-spec.coffee @@ -149,6 +149,55 @@ describe "ContextMenuManager", -> shouldDisplay = false expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual [] + it "prunes a trailing separator", -> + contextMenu.add + '.grandchild': [ + {label: 'A', command: 'a'}, + {type: 'separator'}, + {label: 'B', command: 'b'}, + {type: 'separator'} + ] + + expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(3) + + it "prunes a leading separator", -> + contextMenu.add + '.grandchild': [ + {type: 'separator'}, + {label: 'A', command: 'a'}, + {type: 'separator'}, + {label: 'B', command: 'b'} + ] + + expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(3) + + it "prunes duplicate separators", -> + contextMenu.add + '.grandchild': [ + {label: 'A', command: 'a'}, + {type: 'separator'}, + {type: 'separator'}, + {label: 'B', command: 'b'} + ] + + expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(3) + + it "prunes all redundant separators", -> + contextMenu.add + '.grandchild': [ + {type: 'separator'}, + {type: 'separator'}, + {label: 'A', command: 'a'}, + {type: 'separator'}, + {type: 'separator'}, + {label: 'B', command: 'b'} + {label: 'C', command: 'c'} + {type: 'separator'}, + {type: 'separator'}, + ] + + expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(4) + it "throws an error when the selector is invalid", -> addError = null try diff --git a/spec/integration/fixtures/atom-home/config.cson b/spec/integration/fixtures/atom-home/config.cson deleted file mode 100644 index 4cb63891a..000000000 --- a/spec/integration/fixtures/atom-home/config.cson +++ /dev/null @@ -1,5 +0,0 @@ -"*": - welcome: - showOnStartup: false - "exception-reporting": - userId: "7c0a3c52-795c-5e20-5323-64efcf91f212" diff --git a/spec/integration/smoke-spec.coffee b/spec/integration/smoke-spec.coffee index 34c78db32..3f921c4fe 100644 --- a/spec/integration/smoke-spec.coffee +++ b/spec/integration/smoke-spec.coffee @@ -1,5 +1,6 @@ fs = require 'fs-plus' path = require 'path' +season = require 'season' temp = require('temp').track() runAtom = require './helpers/start-atom' @@ -8,7 +9,12 @@ describe "Smoke Test", -> beforeEach -> jasmine.useRealClock() - fs.writeFileSync(path.join(atomHome, 'config.cson'), fs.readFileSync(path.join(__dirname, 'fixtures', 'atom-home', 'config.cson'))) + season.writeFileSync(path.join(atomHome, 'config.cson'), { + '*': { + welcome: {showOnStartup: false}, + core: {telemetryConsent: 'no'} + } + }) it "can open a file in Atom and perform basic operations on it", -> tempDirPath = temp.mkdirSync("empty-dir") diff --git a/spec/main-process/atom-application.test.js b/spec/main-process/atom-application.test.js index bf788c660..0c3218a99 100644 --- a/spec/main-process/atom-application.test.js +++ b/spec/main-process/atom-application.test.js @@ -22,7 +22,10 @@ describe('AtomApplication', function () { // Symlinking the compile cache into the temporary home dir makes the windows load much faster fs.symlinkSync(path.join(originalAtomHome, 'compile-cache'), path.join(process.env.ATOM_HOME, 'compile-cache')) season.writeFileSync(path.join(process.env.ATOM_HOME, 'config.cson'), { - '*': {welcome: {showOnStartup: false}} + '*': { + welcome: {showOnStartup: false}, + core: {telemetryConsent: 'no'} + } }) atomApplicationsToDestroy = [] }) diff --git a/src/color.js b/src/color.js index 9db9e9b16..6208d6837 100644 --- a/src/color.js +++ b/src/color.js @@ -85,6 +85,10 @@ export default class Color { return `rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})` } + toJSON () { + return this.alpha === 1 ? this.toHexString() : this.toRGBAString() + } + isEqual (color) { if (this === color) { return true diff --git a/src/context-menu-manager.coffee b/src/context-menu-manager.coffee index 936a9c6b6..64360dd2e 100644 --- a/src/context-menu-manager.coffee +++ b/src/context-menu-manager.coffee @@ -145,8 +145,23 @@ class ContextMenuManager currentTarget = currentTarget.parentElement + @pruneRedundantSeparators(template) + template + pruneRedundantSeparators: (menu) -> + keepNextItemIfSeparator = false + index = 0 + while index < menu.length + if menu[index].type is 'separator' + if not keepNextItemIfSeparator or index is menu.length - 1 + menu.splice(index, 1) + else + index++ + else + keepNextItemIfSeparator = true + index++ + # Returns an object compatible with `::add()` or `null`. cloneItemForEvent: (item, event) -> return null if item.devMode and not @devMode diff --git a/src/main-process/atom-application.coffee b/src/main-process/atom-application.coffee index 0fd7f5630..541f70990 100644 --- a/src/main-process/atom-application.coffee +++ b/src/main-process/atom-application.coffee @@ -109,6 +109,8 @@ class AtomApplication @loadState(options) or @openPath(options) openWithOptions: ({initialPaths, pathsToOpen, executedFrom, urlsToOpen, test, pidToKillWhenClosed, devMode, safeMode, newWindow, logFile, profileStartup, timeout, clearWindowState, addToLastWindow, env}) -> + app.focus() + if test @runTests({headless: true, devMode, @resourcePath, executedFrom, pathsToOpen, logFile, timeout, env}) else if pathsToOpen.length > 0 diff --git a/src/main-process/win-shell.coffee b/src/main-process/win-shell.coffee index 2bb993e9c..94c841c47 100644 --- a/src/main-process/win-shell.coffee +++ b/src/main-process/win-shell.coffee @@ -3,6 +3,7 @@ Path = require 'path' exeName = Path.basename(process.execPath) appPath = "\"#{process.execPath}\"" +fileIconPath = "\"#{Path.join(process.execPath, '..', 'resources', 'cli', 'file.ico')}\"" isBeta = appPath.includes(' Beta') appName = exeName.replace('atom', (if isBeta then 'Atom Beta' else 'Atom' )).replace('.exe', '') @@ -40,7 +41,11 @@ class ShellOption exports.appName = appName exports.fileHandler = new ShellOption("\\Software\\Classes\\Applications\\#{exeName}", - [{key: 'shell\\open\\command', name: '', value: "#{appPath} \"%1\""}] + [ + {key: 'shell\\open\\command', name: '', value: "#{appPath} \"%1\""}, + {key: 'shell\\open', name: 'FriendlyAppName', value: "#{appName}"}, + {key: 'DefaultIcon', name: '', value: "#{fileIconPath}"} + ] ) contextParts = [