From ab9efd1913a0a64e10ccd315de9b5a2548a4fefb Mon Sep 17 00:00:00 2001 From: simurai Date: Sat, 7 Nov 2015 21:48:38 +0900 Subject: [PATCH 01/84] Adjust icon size for small buttons --- static/buttons.less | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/static/buttons.less b/static/buttons.less index cf616903a..bfad4dae9 100644 --- a/static/buttons.less +++ b/static/buttons.less @@ -31,12 +31,18 @@ font-size: @font-size - 2px; height: auto; line-height: 1.3em; + &.icon:before { + font-size: 12px; + } } .btn.btn-sm, .btn-group-sm > .btn { padding: @component-padding/4 @component-padding/2; height: auto; line-height: 1.3em; + &.icon:before { + font-size: 14px; + } } .btn.btn-lg, .btn-group-lg > .btn { @@ -63,6 +69,18 @@ border-bottom-right-radius: @component-border-radius; } +// Icon buttons +.btn.icon { + &:before { + width: initial; + height: initial; + margin-right: .3125em; + } + &:empty:before { + margin-right: 0; + } +} + .btn-toolbar { > .btn-group + .btn-group, > .btn-group + .btn, > .btn + .btn { float: none; From f93565708ba63783c16cb76475aec66548d906ab Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 13 Nov 2015 10:54:43 +0100 Subject: [PATCH 02/84] Close empty active window when Close command is given --- spec/workspace-spec.coffee | 16 ++++++++++------ src/register-default-commands.coffee | 2 +- src/workspace.coffee | 12 +++++++++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/spec/workspace-spec.coffee b/spec/workspace-spec.coffee index 5d7343540..124b0917c 100644 --- a/spec/workspace-spec.coffee +++ b/spec/workspace-spec.coffee @@ -1438,11 +1438,11 @@ describe "Workspace", -> save = -> atom.workspace.saveActivePaneItem() expect(save).toThrow() - describe "::destroyActivePaneItemOrEmptyPane", -> + describe "::closeActivePaneItemOrEmptyPaneOrWindow", -> beforeEach -> waitsForPromise -> atom.workspace.open() - it "closes the active pane item until all that remains is a single empty pane", -> + it "closes the active pane item, or the active pane if it is empty, or the current window if there is only the empty root pane", -> atom.config.set('core.destroyEmptyPanes', false) pane1 = atom.workspace.getActivePane() @@ -1450,19 +1450,23 @@ describe "Workspace", -> expect(atom.workspace.getPanes().length).toBe 2 expect(pane2.getItems().length).toBe 1 - atom.workspace.destroyActivePaneItemOrEmptyPane() + atom.workspace.closeActivePaneItemOrEmptyPaneOrWindow() expect(atom.workspace.getPanes().length).toBe 2 expect(pane2.getItems().length).toBe 0 - atom.workspace.destroyActivePaneItemOrEmptyPane() + atom.workspace.closeActivePaneItemOrEmptyPaneOrWindow() expect(atom.workspace.getPanes().length).toBe 1 expect(pane1.getItems().length).toBe 1 - atom.workspace.destroyActivePaneItemOrEmptyPane() + atom.workspace.closeActivePaneItemOrEmptyPaneOrWindow() expect(atom.workspace.getPanes().length).toBe 1 expect(pane1.getItems().length).toBe 0 - atom.workspace.destroyActivePaneItemOrEmptyPane() + atom.workspace.closeActivePaneItemOrEmptyPaneOrWindow() expect(atom.workspace.getPanes().length).toBe 1 + + spyOn(atom, 'close') + atom.workspace.closeActivePaneItemOrEmptyPaneOrWindow() + expect(atom.close).toHaveBeenCalled() diff --git a/src/register-default-commands.coffee b/src/register-default-commands.coffee index 6c838b8c0..159ea1abc 100644 --- a/src/register-default-commands.coffee +++ b/src/register-default-commands.coffee @@ -55,7 +55,7 @@ module.exports = ({commandRegistry, commandInstaller, config}) -> 'window:log-deprecation-warnings': -> Grim.logDeprecations() 'window:toggle-auto-indent': -> config.set("editor.autoIndent", not config.get("editor.autoIndent")) 'pane:reopen-closed-item': -> @getModel().reopenItem() - 'core:close': -> @getModel().destroyActivePaneItemOrEmptyPane() + 'core:close': -> @getModel().closeActivePaneItemOrEmptyPaneOrWindow() 'core:save': -> @getModel().saveActivePaneItem() 'core:save-as': -> @getModel().saveActivePaneItemAs() diff --git a/src/workspace.coffee b/src/workspace.coffee index 396008201..bfa013018 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -675,9 +675,15 @@ class Workspace extends Model destroyActivePane: -> @getActivePane()?.destroy() - # Destroy the active pane item or the active pane if it is empty. - destroyActivePaneItemOrEmptyPane: -> - if @getActivePaneItem()? then @destroyActivePaneItem() else @destroyActivePane() + # Close the active pane item, or the active pane if it is empty, + # or the current window if there is only the empty root pane. + closeActivePaneItemOrEmptyPaneOrWindow: -> + if @getActivePaneItem()? + @destroyActivePaneItem() + else if @getPanes().length > 1 + @destroyActivePane() + else + atom.close() # Increase the editor font size by 1px. increaseFontSize: -> From 97fc92ee3855b89520e580b6aac9bf7152dba85e Mon Sep 17 00:00:00 2001 From: Ivan Zuzak Date: Mon, 16 Nov 2015 18:17:42 +0100 Subject: [PATCH 03/84] Add section on feature suggestions to CONTRIBUTING guide --- CONTRIBUTING.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8170b0121..1f26ec9ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,7 @@ These are just guidelines, not rules, use your best judgment and feel free to pr [How Can I Contribute?](#how-can-i-contribute) * [Reporting Bugs](#reporting-bugs) + * [Suggesting Features](#suggesting-features) * [Your First Code Contribution](#your-first-code-contribution) * [Pull Requests](#pull-requests) @@ -157,6 +158,60 @@ Include details about your configuration and environment: * Problem can be reliably reproduced, doesn't happen randomly: [Yes/No] * Problem happens with all files and projects, not only some files or projects: [Yes/No] +### Suggesting Features + +This section guides you through submitting a feature suggestion for Atom. Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions :mag_right:. + +Before creating feature suggestions, please check [this list](#before-submitting-a-feature-suggestion) as you might find out that you don't need to create one. When you are creating a feature suggestion, please [include as many details as possible](#how-do-i-submit-a-good-feature-suggestion). If you'd like, you can use [this template](#template-for-submitting-feature-suggestions) to structure the information. + +#### Before Submitting A Feature Suggestion + +* **Check the [debugging guide](https://atom.io/docs/latest/hacking-atom-debugging)** for tips — you might discover that the feature is already available. Most importantly, check if you're using [the latest version of Atom](https://atom.io/docs/latest/hacking-atom-debugging#update-to-the-latest-version) and if you can get the desired behavior by changing [Atom's or packages' config settings](https://atom.io/docs/latest/hacking-atom-debugging#check-atom-and-package-settings). +* **Check if there's already [a package](https://atom.io/packages) which provides that feature.** +* **Determine [which repository the feature should be suggested in](#atom-and-packages).** +* **Perform a [cursory search](https://github.com/issues?q=+is%3Aissue+user%3Aatom)** to see if the feature has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. + +#### How Do I Submit A (Good) Feature Suggestion? + +Feature suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined [which repository](#atom-and-packages) your feature suggestions is related to, create an issue on that repository and provide the following information: + +* **Use a clear and descriptive title** for the issue to identify the suggestion. +* **Provide a step-by-step description of the suggested feature** in as many details as possible. +* **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). +* **Describe the current behavior** and **explain which behavior you expected to see instead** and why. +* **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of Atom which the suggestion is related to. You can use [this tool](http://www.cockos.com/licecap/) to record GIFs on OSX and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. +* **Explain why this feature would be useful** to most Atom users and isn't something that can or should be implemented as a [community package](#atom-and-packages). +* **List some other text editors or applications where this feature exists.** +* **Specify which version of Atom you're using.** You can get the exact version by running `atom -v` in your terminal, or by starting Atom and running the `Application: About` command from the [Command Palette](https://github.com/atom/command-palette). +* **Specify the name and version of the OS you're using.** + +#### Template For Submitting Feature Suggestions + + [Short description of suggestion] + + **Steps which explain the feature** + + 1. [First Step] + 2. [Second Step] + 3. [Other Steps...] + + **Current and suggested behavior** + + [Describe current and suggested behavior here] + + **Why would the feature be useful to most users** + + [Explain why the feature would be useful to most users] + + [List some other text editors or applications where this feature exists] + + **Screenshots and GIFs** + + ![Screenshots and GIFs which demonstrate the steps or part of Atom the feature suggestion is related to](url) + + **Atom Version:** [Enter Atom version here] + **OS and Version:** [Enter OS name and version here] + ### Your First Code Contribution Unsure where to begin contributing to Atom? You can start by looking through these `beginner` and `help-wanted` issues: From a121535d5c23b5a777b5ff55ad074110ab7414be Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Tue, 17 Nov 2015 16:59:43 +0100 Subject: [PATCH 04/84] Add travis cache config --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index bf1bd330e..6fed6097c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,13 @@ install: script: script/cibuild +cache: + directories: + - $HOME/.atom/.apm + - $HOME/.atom/.node-gyp/.atom + - $HOME/.atom/.npm + - node_modules + notifications: email: on_success: never From d1434b82ea6ee79f8cd909852b033c8488aacfc9 Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Tue, 17 Nov 2015 17:02:26 +0100 Subject: [PATCH 05/84] Generate fingerprint for CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Here we save a SHA of the package.json and process.platform, and if it’s unchanged, we don’t clean up the node_modules folder. --- script/cibuild | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/script/cibuild b/script/cibuild index c1aedddc8..5e8471506 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,11 +1,13 @@ #!/usr/bin/env node var cp = require('./utils/child-process-wrapper.js'); +var crypto = require('crypto') var fs = require('fs'); var path = require('path'); process.chdir(path.dirname(__dirname)); var homeDir = process.platform == 'win32' ? process.env.USERPROFILE : process.env.HOME; +var fingerprintPath = path.resolve(__dirname, '..', '.atom-ci-fingerprint') function loadEnvironmentVariables(filePath) { try { @@ -42,6 +44,12 @@ function setEnvironmentVariables() { } function removeNodeModules() { + var fingerprint = generateModuleFingerprint() + if (fs.existsSync(fingerprintPath) && fs.readFileSync(fingerprintPath).toString() === fingerprint) { + console.log('node_modules matches current fingerprint ' + fingerprint + ' - not removing') + return + } + var fsPlus; try { fsPlus = require('fs-plus'); @@ -57,6 +65,17 @@ function removeNodeModules() { } } +function generateModuleFingerprint () { + var packageJson = fs.readFileSync(path.resolve(__dirname, '..', 'package.json')) + var body = packageJson.toString() + process.platform + return crypto.createHash('sha1').update(body).digest('hex') +} + +function fingerprintNodeModules (callback) { + fs.writeFileSync(fingerprintPath, generateModuleFingerprint()) + callback(null, fingerprintPath) +} + function removeTempFolders() { var fsPlus; try { @@ -98,7 +117,7 @@ cp.safeExec.bind(global, 'npm install npm --loglevel error', {cwd: path.resolve( var async = require('async'); var gruntPath = path.join('build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : ''); var tasks = [ - cp.safeExec.bind(global, 'git clean -dff'), + cp.safeExec.bind(global, 'git clean -dff -e node_modules -e .atom-ci-fingerprint'), // If we left them behind in removeNodeModules() they are OK to use cp.safeExec.bind(global, gruntPath + ' ci --gruntfile build/Gruntfile.coffee --stack --no-color'), ] async.series(tasks, function(error) { From 5dfed6d22278d2c565131eafa24b3d0c8facab7a Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Tue, 17 Nov 2015 17:41:45 +0100 Subject: [PATCH 06/84] Move fingerprinting to utils --- script/cibuild | 22 +++++----------------- script/utils/fingerprint.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 script/utils/fingerprint.js diff --git a/script/cibuild b/script/cibuild index 5e8471506..b3f0b3f83 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,13 +1,13 @@ #!/usr/bin/env node var cp = require('./utils/child-process-wrapper.js'); var crypto = require('crypto') +var fingerprint = require('./utils/fingerprint') var fs = require('fs'); var path = require('path'); process.chdir(path.dirname(__dirname)); var homeDir = process.platform == 'win32' ? process.env.USERPROFILE : process.env.HOME; -var fingerprintPath = path.resolve(__dirname, '..', '.atom-ci-fingerprint') function loadEnvironmentVariables(filePath) { try { @@ -44,9 +44,8 @@ function setEnvironmentVariables() { } function removeNodeModules() { - var fingerprint = generateModuleFingerprint() - if (fs.existsSync(fingerprintPath) && fs.readFileSync(fingerprintPath).toString() === fingerprint) { - console.log('node_modules matches current fingerprint ' + fingerprint + ' - not removing') + if (fingerprint.fingerprintMatches()) { + console.log('node_modules matches current fingerprint ' + fingerprint.fingerprint() + ' - not removing') return } @@ -65,17 +64,6 @@ function removeNodeModules() { } } -function generateModuleFingerprint () { - var packageJson = fs.readFileSync(path.resolve(__dirname, '..', 'package.json')) - var body = packageJson.toString() + process.platform - return crypto.createHash('sha1').update(body).digest('hex') -} - -function fingerprintNodeModules (callback) { - fs.writeFileSync(fingerprintPath, generateModuleFingerprint()) - callback(null, fingerprintPath) -} - function removeTempFolders() { var fsPlus; try { @@ -117,8 +105,8 @@ cp.safeExec.bind(global, 'npm install npm --loglevel error', {cwd: path.resolve( var async = require('async'); var gruntPath = path.join('build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : ''); var tasks = [ - cp.safeExec.bind(global, 'git clean -dff -e node_modules -e .atom-ci-fingerprint'), // If we left them behind in removeNodeModules() they are OK to use - cp.safeExec.bind(global, gruntPath + ' ci --gruntfile build/Gruntfile.coffee --stack --no-color'), + cp.safeExec.bind(global, 'git clean -dff -e node_modules'), // If we left them behind in removeNodeModules() they are OK to use + cp.safeExec.bind(global, gruntPath + ' ci --gruntfile build/Gruntfile.coffee --stack --no-color') ] async.series(tasks, function(error) { process.exit(error ? 1 : 0); diff --git a/script/utils/fingerprint.js b/script/utils/fingerprint.js new file mode 100644 index 000000000..3a189fa9d --- /dev/null +++ b/script/utils/fingerprint.js @@ -0,0 +1,31 @@ +var crypto = require('crypto') +var fs = require('fs') +var path = require('path') + +var fingerprintPath = path.resolve(__dirname, '..', '..', 'node_modules', '.atom-ci-fingerprint') + +module.exports = { + fingerprint: function () { + var packageJson = fs.readFileSync(path.resolve(__dirname, '..', '..', 'package.json')) + var body = packageJson.toString() + process.platform + return crypto.createHash('sha1').update(body).digest('hex') + }, + + writeFingerprint: function () { + var fingerprint = this.fingerprint() + fs.writeFileSync(fingerprintPath, fingerprint) + console.log('Wrote ci fingerprint:', fingerprintPath, fingerprint) + } + + readFingerprint: function() { + if (fs.existsSync(fingerprintPath)) { + return fs.readFileSync(fingerprintPath).toString() + } else { + return null + } + } + + fingerprintMatches: function () { + return this.readFingerprint() && this.readFingerprint() === this.fingerprint() + } +} From 24f385db2c57b14545c6133576ff9409966afa35 Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Tue, 17 Nov 2015 17:42:04 +0100 Subject: [PATCH 07/84] Add fingerprint grunt task --- build/tasks/fingerprint-task.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 build/tasks/fingerprint-task.js diff --git a/build/tasks/fingerprint-task.js b/build/tasks/fingerprint-task.js new file mode 100644 index 000000000..9cfcdae76 --- /dev/null +++ b/build/tasks/fingerprint-task.js @@ -0,0 +1,7 @@ +var fingerprint = require('../../script/utils/fingerprint') + +module.exports = function (grunt) { + grunt.registerTask('fingerprint', 'Fingerpint the node_modules folder for caching on CI', function () { + fingerprint.writeFingerprint() + }) +} From cbeca5ad07ebc569ea9f2580a9965087bdeabe1d Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Tue, 17 Nov 2015 17:42:17 +0100 Subject: [PATCH 08/84] Add fingerprint after build in ciTasks --- build/Gruntfile.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index 8dd1c573b..26d9c2f42 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -284,6 +284,7 @@ module.exports = (grunt) -> ciTasks.push('download-electron') ciTasks.push('download-electron-chromedriver') ciTasks.push('build') + ciTasks.push('fingerprint') ciTasks.push('dump-symbols') if process.platform isnt 'win32' ciTasks.push('set-version', 'check-licenses', 'lint', 'generate-asar') ciTasks.push('mkdeb') if process.platform is 'linux' From 8005d53c3a4645c8837d463236d26ffaa45fb460 Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Tue, 17 Nov 2015 17:42:51 +0100 Subject: [PATCH 09/84] Add a couple missing commas --- script/utils/fingerprint.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/utils/fingerprint.js b/script/utils/fingerprint.js index 3a189fa9d..4bdf07baa 100644 --- a/script/utils/fingerprint.js +++ b/script/utils/fingerprint.js @@ -15,7 +15,7 @@ module.exports = { var fingerprint = this.fingerprint() fs.writeFileSync(fingerprintPath, fingerprint) console.log('Wrote ci fingerprint:', fingerprintPath, fingerprint) - } + }, readFingerprint: function() { if (fs.existsSync(fingerprintPath)) { @@ -23,7 +23,7 @@ module.exports = { } else { return null } - } + }, fingerprintMatches: function () { return this.readFingerprint() && this.readFingerprint() === this.fingerprint() From a9bf2a73a586638831a202aafc83148c5adb78f7 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 16 Nov 2015 19:46:53 +0100 Subject: [PATCH 10/84] Improve TextEditor::getLongTitle --- .../sample-theme-2/src/js/plugin/main.js | 0 spec/text-editor-spec.coffee | 23 +++++-- src/text-editor.coffee | 66 +++++++++++-------- 3 files changed, 54 insertions(+), 35 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/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 From 4bc4c6888f1dca0feb08c517d90f04d3e265dac6 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Mon, 16 Nov 2015 19:47:07 +0100 Subject: [PATCH 11/84] Use unique text editor title in window and tab titles --- src/workspace.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a8bf594aede2632299e227d17359f1bc0492ed89 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Tue, 17 Nov 2015 21:51:12 -0500 Subject: [PATCH 12/84] Suggest [ci skip] in documentation-only commits --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8170b0121..871854a99 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -200,6 +200,7 @@ Both issue lists are sorted by total number of comments. While not perfect, numb * Use the imperative mood ("Move cursor to..." not "Moves cursor to...") * Limit the first line to 72 characters or less * Reference issues and pull requests liberally +* When only changing documentation, include `[ci skip]` in the commit description * Consider starting the commit message with an applicable emoji: * :art: `:art:` when improving the format/structure of the code * :racehorse: `:racehorse:` when improving performance From 962b814bb653e4a77795ed22c9e7c4cf90060e10 Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Wed, 18 Nov 2015 16:13:58 +0100 Subject: [PATCH 13/84] add node version to fingerprint --- script/utils/fingerprint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/utils/fingerprint.js b/script/utils/fingerprint.js index 4bdf07baa..2da48039f 100644 --- a/script/utils/fingerprint.js +++ b/script/utils/fingerprint.js @@ -7,7 +7,7 @@ var fingerprintPath = path.resolve(__dirname, '..', '..', 'node_modules', '.atom module.exports = { fingerprint: function () { var packageJson = fs.readFileSync(path.resolve(__dirname, '..', '..', 'package.json')) - var body = packageJson.toString() + process.platform + var body = packageJson.toString() + process.platform + process.version return crypto.createHash('sha1').update(body).digest('hex') }, From 5c701ed5dfe1bd4947a9783552256aa1bf3a62ef Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 18 Nov 2015 15:46:30 +0100 Subject: [PATCH 14/84] Use long title in tests --- spec/workspace-spec.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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", -> From c81913f917d1bb5b3ddd36109965cd2f2e04a2ef Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Wed, 18 Nov 2015 15:49:36 -0500 Subject: [PATCH 15/84] :arrow_up: notifications@0.62.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b488ba3ce..f78c3d9b2 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "link": "0.31.0", "markdown-preview": "0.156.2", "metrics": "0.53.0", - "notifications": "0.61.0", + "notifications": "0.62.0", "open-on-github": "0.40.0", "package-generator": "0.41.0", "release-notes": "0.53.0", From 799a792f7f03de8d8fdd2f41559e578f806a8539 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 18 Nov 2015 13:05:27 -0800 Subject: [PATCH 16/84] Remove public docs for DirectorySearch and DefaultDirectorySearcher --- src/default-directory-searcher.coffee | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/default-directory-searcher.coffee b/src/default-directory-searcher.coffee index 1c9b40312..6b8ffe3e3 100644 --- a/src/default-directory-searcher.coffee +++ b/src/default-directory-searcher.coffee @@ -1,8 +1,7 @@ Task = require './task' -# Public: Searches local files for lines matching a specified regex. -# -# Implements thenable so it can be used with `Promise.all()`. +# Searches local files for lines matching a specified regex. Implements `.then()` +# so that it can be used with `Promise.all()`. class DirectorySearch constructor: (rootPaths, regex, options) -> scanHandlerOptions = @@ -22,31 +21,25 @@ class DirectorySearch @task.terminate() resolve() - # Public: Implementation of `then()` to satisfy the *thenable* contract. - # This makes it possible to use a `DirectorySearch` with `Promise.all()`. - # - # Returns `Promise`. then: (args...) -> @promise.then.apply(@promise, args) - # Public: Cancels the search. cancel: -> # This will cause @promise to reject. @task.cancel() null - # Default provider for the `atom.directory-searcher` service. module.exports = class DefaultDirectorySearcher - # Public: Determines whether this object supports search for a `Directory`. + # Determines whether this object supports search for a `Directory`. # # * `directory` {Directory} whose search needs might be supported by this object. # # Returns a `boolean` indicating whether this object can search this `Directory`. canSearchDirectory: (directory) -> true - # Public: Performs a text search for files in the specified `Directory`, subject to the + # Performs a text search for files in the specified `Directory`, subject to the # specified parameters. # # Results are streamed back to the caller by invoking methods on the specified `options`, From 17c5198299f22138619ec2dadf3c89fd8fac5d15 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Wed, 18 Nov 2015 16:07:41 -0500 Subject: [PATCH 17/84] :arrow_up: language-xml@0.34.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f78c3d9b2..e389ade0b 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,7 @@ "language-text": "0.7.0", "language-todo": "0.27.0", "language-toml": "0.16.0", - "language-xml": "0.34.0", + "language-xml": "0.34.1", "language-yaml": "0.24.0" }, "private": true, From b04c26ba300dc291273355abe9a537a65ed6b1f6 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 17 Nov 2015 11:45:51 -0800 Subject: [PATCH 18/84] Discard highlights that end above the visible row range Fixes #9628 --- spec/text-editor-presenter-spec.coffee | 12 ++++++++++++ src/text-editor-presenter.coffee | 26 ++++++++++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/spec/text-editor-presenter-spec.coffee b/spec/text-editor-presenter-spec.coffee index 54899a1d6..06a857a64 100644 --- a/spec/text-editor-presenter-spec.coffee +++ b/spec/text-editor-presenter-spec.coffee @@ -1704,6 +1704,18 @@ describe "TextEditorPresenter", -> expectUndefinedStateForHighlight(presenter, highlight) + it "does not include highlights that end before the first visible row", -> + editor.setText("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.") + editor.setSoftWrapped(true) + editor.setWidth(100, true) + editor.setDefaultCharWidth(10) + + marker = editor.markBufferRange([[0, 0], [0, 4]], invalidate: 'never') + highlight = editor.decorateMarker(marker, type: 'highlight', class: 'a') + presenter = buildPresenter(explicitHeight: 30, scrollTop: 10, tileSize: 2) + + expect(stateForHighlightInTile(presenter, highlight, 0)).toBeUndefined() + it "updates when ::scrollTop changes", -> editor.setSelectedBufferRanges([ [[6, 2], [6, 4]], diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 7bd66b87f..b1f28af11 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -1244,14 +1244,7 @@ class TextEditorPresenter updateHighlightState: (decorationId, properties, screenRange) -> return unless @startRow? and @endRow? and @lineHeight? and @hasPixelPositionRequirements() - return if screenRange.isEmpty() - - if screenRange.start.row < @startRow - screenRange.start.row = @startRow - screenRange.start.column = 0 - if screenRange.end.row >= @endRow - screenRange.end.row = @endRow - screenRange.end.column = 0 + @constrainRangeToVisibleRowRange(screenRange) return if screenRange.isEmpty() @@ -1281,6 +1274,23 @@ class TextEditorPresenter true + constrainRangeToVisibleRowRange: (screenRange) -> + if screenRange.start.row < @startRow + screenRange.start.row = @startRow + screenRange.start.column = 0 + + if screenRange.end.row < @startRow + screenRange.end.row = @startRow + screenRange.end.column = 0 + + if screenRange.start.row >= @endRow + screenRange.start.row = @endRow + screenRange.start.column = 0 + + if screenRange.end.row >= @endRow + screenRange.end.row = @endRow + screenRange.end.column = 0 + repositionRegionWithinTile: (region, tileStartRow) -> region.top += @scrollTop - tileStartRow * @lineHeight region.left += @scrollLeft From e572763cf78ea0ecde2564ff60b637f958c40edc Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 18 Nov 2015 22:21:27 -0800 Subject: [PATCH 19/84] Remove unnecessary fat arrow --- src/config.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.coffee b/src/config.coffee index 888193059..489e16016 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -699,7 +699,7 @@ class Config @endTransaction() fn(args...) result = callback() - new Promise (resolve, reject) => + new Promise (resolve, reject) -> result.then(endTransaction(resolve)).catch(endTransaction(reject)) catch error @endTransaction() From 69a0acd5547ddf160396a9f8af79fa1ccfb7f232 Mon Sep 17 00:00:00 2001 From: abe33 Date: Mon, 16 Nov 2015 10:06:35 +0100 Subject: [PATCH 20/84] :bug: Fix typo in project deserializer method Addresses #9598 --- src/project.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/project.coffee b/src/project.coffee index 935e3a213..bb9c8be80 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -55,7 +55,7 @@ class Project extends Model ### deserialize: (state, deserializerManager) -> - states.paths = [state.path] if state.path? # backward compatibility + state.paths = [state.path] if state.path? # backward compatibility @buffers = _.compact state.buffers.map (bufferState) -> # Check that buffer's file path is accessible From fb5b1ba7f394e7c970d04d29af551d81c2fd277b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 19 Nov 2015 07:13:37 -0800 Subject: [PATCH 21/84] 1.2.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7f0914b69..cd970440d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.2.2", + "version": "1.2.3", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From 2d1c35805eff2591133c9176d920c4e692fd3342 Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Thu, 19 Nov 2015 16:32:12 +0100 Subject: [PATCH 22/84] :arrow_up:legal-eagle@0.13.0 - adds Public Domain as a permissive license type. --- build/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/package.json b/build/package.json index 2ce92de17..de9053006 100644 --- a/build/package.json +++ b/build/package.json @@ -27,7 +27,7 @@ "grunt-peg": "~1.1.0", "grunt-shell": "~0.3.1", "grunt-standard": "^1.0.2", - "legal-eagle": "~0.12.0", + "legal-eagle": "~0.13.0", "minidump": "~0.9", "npm": "2.13.3", "rcedit": "~0.3.0", From a126374a7b1a2cefd096aaf884f1de3e1082ca5c Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 18 Nov 2015 10:41:07 -0800 Subject: [PATCH 23/84] Coerce boolean options to booleans Pairing with @as-cii --- src/browser/atom-application.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index 8bb44349e..8e8e4af54 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -373,6 +373,8 @@ class AtomApplication # :windowDimensions - Object with height and width keys. # :window - {AtomWindow} to open file paths in. openPaths: ({pathsToOpen, executedFrom, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions, profileStartup, window}={}) -> + devMode = Boolean(devMode) + safeMode = Boolean(safeMode) locationsToOpen = (@locationForPathToOpen(pathToOpen, executedFrom) for pathToOpen in pathsToOpen) pathsToOpen = (locationToOpen.pathToOpen for locationToOpen in locationsToOpen) From ced8dbb9c313c884a8ea233076a46959a2306357 Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Thu, 19 Nov 2015 17:43:48 +0100 Subject: [PATCH 24/84] only cache node_modules in case it's leading to these other build failures --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6fed6097c..3ce84c266 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,9 +34,6 @@ script: script/cibuild cache: directories: - - $HOME/.atom/.apm - - $HOME/.atom/.node-gyp/.atom - - $HOME/.atom/.npm - node_modules notifications: From 57503e4294b0826e994f54392697e9a2207dc722 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 19 Nov 2015 11:09:37 -0800 Subject: [PATCH 25/84] Prepare 1.3.0-beta5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 92da702e3..1f6686295 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.3.0-beta4", + "version": "1.3.0-beta5", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From 23102198ced59593cab282f5a1dd45850692b9bf Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 18 Nov 2015 20:58:19 -0800 Subject: [PATCH 26/84] =?UTF-8?q?Don=E2=80=99t=20change=20key=20name=20in?= =?UTF-8?q?=20serialized=20application=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We changed it internally for clarity, but this is breaking compatibility with restoring state when upgrading from previous versions. Fixes #9690 --- src/browser/atom-application.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index f825899e3..7f182b584 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -441,7 +441,7 @@ class AtomApplication states = [] for window in @windows if not window.isSpec and window.projectDirectoryPaths? - states.push(projectDirectoryPaths: window.projectDirectoryPaths) + states.push(initialPaths: window.projectDirectoryPaths) if states.length > 0 or allowEmpty @storageFolder.store('application.json', states) @@ -449,7 +449,7 @@ class AtomApplication if (states = @storageFolder.load('application.json'))?.length > 0 for state in states @openWithOptions(_.extend(options, { - pathsToOpen: state.projectDirectoryPaths + pathsToOpen: state.initialPaths urlsToOpen: [] devMode: @devMode safeMode: @safeMode From a285d34c89f35ee0deb5c745a2adb66e6f625022 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 19 Nov 2015 16:06:22 -0500 Subject: [PATCH 27/84] :arrow_up: language-coffee-script@0.45.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e389ade0b..15d98f357 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "wrap-guide": "0.38.1", "language-c": "0.49.0", "language-clojure": "0.18.0", - "language-coffee-script": "0.43.0", + "language-coffee-script": "0.45.0", "language-csharp": "0.11.0", "language-css": "0.35.0", "language-gfm": "0.81.0", From 878ad232dcbe1cc15a07339d8a1ca1b3296ba806 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 19 Nov 2015 16:06:57 -0500 Subject: [PATCH 28/84] :arrow_up: language-javascript@0.102.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 15d98f357..d3e1af17a 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "language-html": "0.42.0", "language-hyperlink": "0.15.0", "language-java": "0.16.1", - "language-javascript": "0.101.1", + "language-javascript": "0.102.0", "language-json": "0.17.1", "language-less": "0.28.3", "language-make": "0.20.0", From cad74060855aa37c5de528d6f03761ac74170103 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 19 Nov 2015 16:07:31 -0500 Subject: [PATCH 29/84] :arrow_up: language-sass@0.44.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d3e1af17a..106b6e0b7 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "language-python": "0.42.1", "language-ruby": "0.64.0", "language-ruby-on-rails": "0.24.0", - "language-sass": "0.43.0", + "language-sass": "0.44.0", "language-shellscript": "0.20.0", "language-source": "0.9.0", "language-sql": "0.19.0", From ff08642d3bcebed619149578e3eeaa3427ca2c1c Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 16:32:38 -0800 Subject: [PATCH 30/84] Return early in FakeLinesYardstick for unrendered rows This allows us to have a more consistent behavior with the real LinesYardstick. --- spec/fake-lines-yardstick.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/fake-lines-yardstick.coffee b/spec/fake-lines-yardstick.coffee index 9934b1917..1872b8c65 100644 --- a/spec/fake-lines-yardstick.coffee +++ b/spec/fake-lines-yardstick.coffee @@ -7,6 +7,7 @@ class FakeLinesYardstick prepareScreenRowsForMeasurement: -> @presenter.getPreMeasurementState() + @screenRows = new Set(@presenter.getScreenRows()) getScopedCharacterWidth: (scopeNames, char) -> @getScopedCharacterWidths(scopeNames)[char] @@ -34,6 +35,8 @@ class FakeLinesYardstick left = 0 column = 0 + return {top, left: 0} unless @screenRows.has(screenPosition.row) + iterator = @model.tokenizedLineForScreenRow(targetRow).getTokenIterator() while iterator.next() characterWidths = @getScopedCharacterWidths(iterator.getScopes()) From 0218431c62b8f4cbde2844ad39e27d407510a32d Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 16:38:19 -0800 Subject: [PATCH 31/84] :bug: Compute content width when the longest row is the first one --- spec/text-editor-presenter-spec.coffee | 14 ++++++++++++++ src/text-editor-presenter.coffee | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/spec/text-editor-presenter-spec.coffee b/spec/text-editor-presenter-spec.coffee index 06a857a64..8dd34fde8 100644 --- a/spec/text-editor-presenter-spec.coffee +++ b/spec/text-editor-presenter-spec.coffee @@ -694,6 +694,20 @@ describe "TextEditorPresenter", -> presenter = buildPresenter(explicitHeight: 100, contentFrameWidth: 10 * maxLineLength + 20, baseCharacterWidth: 10, verticalScrollbarWidth: 10) expect(presenter.getState().content.scrollWidth).toBe 10 * maxLineLength + 20 - 10 # subtract vertical scrollbar width + describe "when the longest screen row is the first one and it's hidden", -> + it "doesn't compute an invalid value (regression)", -> + presenter = buildPresenter(tileSize: 2, contentFrameWidth: 10, explicitHeight: 20) + editor.setText """ + a very long long long long long long line + b + c + d + e + """ + + expectStateUpdate presenter, -> presenter.setScrollTop(40) + expect(presenter.getState().content.scrollWidth).toBe 10 * editor.getMaxScreenLineLength() + 1 + it "updates when the ::contentFrameWidth changes", -> maxLineLength = editor.getMaxScreenLineLength() presenter = buildPresenter(contentFrameWidth: 50, baseCharacterWidth: 10) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index b1f28af11..405e34548 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -377,7 +377,8 @@ class TextEditorPresenter endRow = @constrainRow(@getEndTileRow() + @tileSize) screenRows = [startRow...endRow] - if longestScreenRow = @model.getLongestScreenRow() + longestScreenRow = @model.getLongestScreenRow() + if longestScreenRow? screenRows.push(longestScreenRow) if @screenRowsToMeasure? screenRows.push(@screenRowsToMeasure...) From e919b85fbe68f4b27fc4fbf33c11879fd0ce31b0 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 10:13:58 -0800 Subject: [PATCH 32/84] Export ::isTextEditor function --- exports/atom.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/exports/atom.coffee b/exports/atom.coffee index c3601e1cc..e28b080f6 100644 --- a/exports/atom.coffee +++ b/exports/atom.coffee @@ -23,10 +23,15 @@ module.exports = unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE module.exports.Task = require '../src/task' + InternalTextEditor = require('../src/text-editor') + + module.exports.isTextEditor = (object) -> + object instanceof InternalTextEditor + TextEditor = (params) -> atom.workspace.buildTextEditor(params) - TextEditor.prototype = require('../src/text-editor').prototype + TextEditor.prototype = InternalTextEditor.prototype Object.defineProperty module.exports, 'TextEditor', enumerable: true From d427091b494be3c5e5fe0f5033c8023bf5bb6b74 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 17:04:18 -0800 Subject: [PATCH 33/84] :white_check_mark: Write specs for ::isTextEditor --- spec/atom-exports-spec.coffee | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 spec/atom-exports-spec.coffee diff --git a/spec/atom-exports-spec.coffee b/spec/atom-exports-spec.coffee new file mode 100644 index 000000000..05752404d --- /dev/null +++ b/spec/atom-exports-spec.coffee @@ -0,0 +1,7 @@ +{isTextEditor} = require 'atom' + +describe "atom exports", -> + describe "::isTextEditor(obj)", -> + it "returns true when the passed object is an instance of `TextEditor`", -> + expect(isTextEditor(atom.workspace.buildTextEditor())).toBe(true) + expect(isTextEditor({getText: ->})).toBe(false) From 2a9cfe6ff148e6cb177934b9fafbe08c3aa80f27 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 17:10:13 -0800 Subject: [PATCH 34/84] :memo: Update deprecation message --- exports/atom.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exports/atom.coffee b/exports/atom.coffee index e28b080f6..952ee0595 100644 --- a/exports/atom.coffee +++ b/exports/atom.coffee @@ -40,7 +40,7 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE The `TextEditor` constructor is no longer public. To construct a text editor, use `atom.workspace.buildTextEditor()`. - To check if an object is a text editor, look for for the existence of - a public method that you're using (e.g. `::getText`). + To check if an object is a text editor, use the `isTextEditor` + function in the `atom` exports. (e.g. `{isTextEditor} = require('atom'))` """ TextEditor From 85ee586e2e67a6a661b5b3cb99cb4709106ca6c9 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 17:30:33 -0800 Subject: [PATCH 35/84] :white_check_mark: More specs --- spec/atom-exports-spec.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/atom-exports-spec.coffee b/spec/atom-exports-spec.coffee index 05752404d..72150b97e 100644 --- a/spec/atom-exports-spec.coffee +++ b/spec/atom-exports-spec.coffee @@ -5,3 +5,5 @@ describe "atom exports", -> it "returns true when the passed object is an instance of `TextEditor`", -> expect(isTextEditor(atom.workspace.buildTextEditor())).toBe(true) expect(isTextEditor({getText: ->})).toBe(false) + expect(isTextEditor(null)).toBe(false) + expect(isTextEditor(undefined)).toBe(false) From 93481c8a0d4c604868715d0572b2b51a614fbacd Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 17:56:53 -0800 Subject: [PATCH 36/84] Move ::isTextEditor down into Workspace --- exports/atom.coffee | 11 +++-------- spec/atom-exports-spec.coffee | 9 --------- spec/workspace-spec.coffee | 7 +++++++ src/workspace.coffee | 6 ++++++ 4 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 spec/atom-exports-spec.coffee diff --git a/exports/atom.coffee b/exports/atom.coffee index 952ee0595..c3601e1cc 100644 --- a/exports/atom.coffee +++ b/exports/atom.coffee @@ -23,15 +23,10 @@ module.exports = unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE module.exports.Task = require '../src/task' - InternalTextEditor = require('../src/text-editor') - - module.exports.isTextEditor = (object) -> - object instanceof InternalTextEditor - TextEditor = (params) -> atom.workspace.buildTextEditor(params) - TextEditor.prototype = InternalTextEditor.prototype + TextEditor.prototype = require('../src/text-editor').prototype Object.defineProperty module.exports, 'TextEditor', enumerable: true @@ -40,7 +35,7 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE The `TextEditor` constructor is no longer public. To construct a text editor, use `atom.workspace.buildTextEditor()`. - To check if an object is a text editor, use the `isTextEditor` - function in the `atom` exports. (e.g. `{isTextEditor} = require('atom'))` + To check if an object is a text editor, look for for the existence of + a public method that you're using (e.g. `::getText`). """ TextEditor diff --git a/spec/atom-exports-spec.coffee b/spec/atom-exports-spec.coffee deleted file mode 100644 index 72150b97e..000000000 --- a/spec/atom-exports-spec.coffee +++ /dev/null @@ -1,9 +0,0 @@ -{isTextEditor} = require 'atom' - -describe "atom exports", -> - describe "::isTextEditor(obj)", -> - it "returns true when the passed object is an instance of `TextEditor`", -> - expect(isTextEditor(atom.workspace.buildTextEditor())).toBe(true) - expect(isTextEditor({getText: ->})).toBe(false) - expect(isTextEditor(null)).toBe(false) - expect(isTextEditor(undefined)).toBe(false) diff --git a/spec/workspace-spec.coffee b/spec/workspace-spec.coffee index 5d7343540..7012d2c4b 100644 --- a/spec/workspace-spec.coffee +++ b/spec/workspace-spec.coffee @@ -658,6 +658,13 @@ describe "Workspace", -> waitsForPromise -> workspace.openLicense() runs -> expect(workspace.getActivePaneItem().getText()).toMatch /Copyright/ + describe "::isTextEditor(obj)", -> + it "returns true when the passed object is an instance of `TextEditor`", -> + expect(workspace.isTextEditor(atom.workspace.buildTextEditor())).toBe(true) + expect(workspace.isTextEditor({getText: ->})).toBe(false) + expect(workspace.isTextEditor(null)).toBe(false) + expect(workspace.isTextEditor(undefined)).toBe(false) + describe "::observeTextEditors()", -> it "invokes the observer with current and future text editors", -> observed = [] diff --git a/src/workspace.coffee b/src/workspace.coffee index 396008201..c043c36cf 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -518,6 +518,12 @@ class Workspace extends Model @project.bufferForPath(filePath, options).then (buffer) => @buildTextEditor(_.extend({buffer, largeFileMode}, options)) + # Public: Returns a {Boolean} that is `true` if `object` is a `TextEditor`. + # + # * `object` An {Object} you want to perform the check against. + isTextEditor: (object) -> + object instanceof TextEditor + # Extended: Create a new text editor. # # Returns a {TextEditor}. From 4abf5922aab9c91098ee6fc874edb117490d3f75 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 17:57:47 -0800 Subject: [PATCH 37/84] :memo: :art: --- exports/atom.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exports/atom.coffee b/exports/atom.coffee index c3601e1cc..81d1726b8 100644 --- a/exports/atom.coffee +++ b/exports/atom.coffee @@ -35,7 +35,6 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE The `TextEditor` constructor is no longer public. To construct a text editor, use `atom.workspace.buildTextEditor()`. - To check if an object is a text editor, look for for the existence of - a public method that you're using (e.g. `::getText`). + To check if an object is a text editor, use `atom.workspace.isTextEditor(object)`. """ TextEditor From ff15a73e88973b7aeef5a81150df1a9d4312c089 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 19 Nov 2015 21:46:54 -0500 Subject: [PATCH 38/84] :arrow_up: notifications@0.62.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 106b6e0b7..9c9afc546 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "link": "0.31.0", "markdown-preview": "0.156.2", "metrics": "0.53.0", - "notifications": "0.62.0", + "notifications": "0.62.1", "open-on-github": "0.40.0", "package-generator": "0.41.0", "release-notes": "0.53.0", From a7809d67728932499130a30cf9ee4e3e6edf08a9 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 20 Nov 2015 16:40:55 +0100 Subject: [PATCH 39/84] Add 'Close Empty Windows' option.' --- src/config-schema.coffee | 8 ++++++-- src/workspace.coffee | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/config-schema.coffee b/src/config-schema.coffee index 08956d470..d9c0c1d21 100644 --- a/src/config-schema.coffee +++ b/src/config-schema.coffee @@ -21,7 +21,6 @@ module.exports = followSymlinks: type: 'boolean' default: true - title: 'Follow symlinks' description: 'Follow symbolic links when searching files and when opening files with the fuzzy finder.' disabledPackages: type: 'array' @@ -54,7 +53,12 @@ module.exports = destroyEmptyPanes: type: 'boolean' default: true - description: 'When the last item of a pane is removed, remove that pane as well.' + title: 'Remove Empty Panes' + description: 'When the last tab of a pane is closed, remove that pane as well.' + closeEmptyWindows: + type: 'boolean' + default: true + description: 'When a window with no open tabs or panes is given the \'Close Tab\' command, close that window.' fileEncoding: description: 'Default character set encoding to use when reading and writing files.' type: 'string' diff --git a/src/workspace.coffee b/src/workspace.coffee index bfa013018..704b0e8a4 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -682,7 +682,7 @@ class Workspace extends Model @destroyActivePaneItem() else if @getPanes().length > 1 @destroyActivePane() - else + else if @config.get('core.closeEmptyWindows') atom.close() # Increase the editor font size by 1px. From 704da43800b1d91a6fad983e4f190487e1465a92 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 20 Nov 2015 10:34:05 -0700 Subject: [PATCH 40/84] Prevent spec from closing window --- spec/workspace-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/workspace-spec.coffee b/spec/workspace-spec.coffee index 124b0917c..1a28eea45 100644 --- a/spec/workspace-spec.coffee +++ b/spec/workspace-spec.coffee @@ -1440,6 +1440,7 @@ describe "Workspace", -> describe "::closeActivePaneItemOrEmptyPaneOrWindow", -> beforeEach -> + spyOn(atom, 'close') waitsForPromise -> atom.workspace.open() it "closes the active pane item, or the active pane if it is empty, or the current window if there is only the empty root pane", -> @@ -1467,6 +1468,5 @@ describe "Workspace", -> atom.workspace.closeActivePaneItemOrEmptyPaneOrWindow() expect(atom.workspace.getPanes().length).toBe 1 - spyOn(atom, 'close') atom.workspace.closeActivePaneItemOrEmptyPaneOrWindow() expect(atom.close).toHaveBeenCalled() From e5165814e691e5844d00068f7b388e3e49dbe6d4 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 16:32:38 -0800 Subject: [PATCH 41/84] Return early in FakeLinesYardstick for unrendered rows This allows us to have a more consistent behavior with the real LinesYardstick. --- spec/fake-lines-yardstick.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/fake-lines-yardstick.coffee b/spec/fake-lines-yardstick.coffee index 9934b1917..1872b8c65 100644 --- a/spec/fake-lines-yardstick.coffee +++ b/spec/fake-lines-yardstick.coffee @@ -7,6 +7,7 @@ class FakeLinesYardstick prepareScreenRowsForMeasurement: -> @presenter.getPreMeasurementState() + @screenRows = new Set(@presenter.getScreenRows()) getScopedCharacterWidth: (scopeNames, char) -> @getScopedCharacterWidths(scopeNames)[char] @@ -34,6 +35,8 @@ class FakeLinesYardstick left = 0 column = 0 + return {top, left: 0} unless @screenRows.has(screenPosition.row) + iterator = @model.tokenizedLineForScreenRow(targetRow).getTokenIterator() while iterator.next() characterWidths = @getScopedCharacterWidths(iterator.getScopes()) From cbfee4e8097bffb6ed38143b18eb6d58226efc84 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Nov 2015 16:38:19 -0800 Subject: [PATCH 42/84] :bug: Compute content width when the longest row is the first one --- spec/text-editor-presenter-spec.coffee | 14 ++++++++++++++ src/text-editor-presenter.coffee | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/spec/text-editor-presenter-spec.coffee b/spec/text-editor-presenter-spec.coffee index 1804b7b6b..34b8d2443 100644 --- a/spec/text-editor-presenter-spec.coffee +++ b/spec/text-editor-presenter-spec.coffee @@ -680,6 +680,20 @@ describe "TextEditorPresenter", -> presenter = buildPresenter(explicitHeight: 100, contentFrameWidth: 10 * maxLineLength + 20, baseCharacterWidth: 10, verticalScrollbarWidth: 10) expect(presenter.getState().content.scrollWidth).toBe 10 * maxLineLength + 20 - 10 # subtract vertical scrollbar width + describe "when the longest screen row is the first one and it's hidden", -> + it "doesn't compute an invalid value (regression)", -> + presenter = buildPresenter(tileSize: 2, contentFrameWidth: 10, explicitHeight: 20) + editor.setText """ + a very long long long long long long line + b + c + d + e + """ + + expectStateUpdate presenter, -> presenter.setScrollTop(40) + expect(presenter.getState().content.scrollWidth).toBe 10 * editor.getMaxScreenLineLength() + 1 + it "updates when the ::contentFrameWidth changes", -> maxLineLength = editor.getMaxScreenLineLength() presenter = buildPresenter(contentFrameWidth: 50, baseCharacterWidth: 10) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 2e1d73c56..724e8b723 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -380,7 +380,8 @@ class TextEditorPresenter endRow = @constrainRow(@getEndTileRow() + @tileSize) screenRows = [startRow...endRow] - if longestScreenRow = @model.getLongestScreenRow() + longestScreenRow = @model.getLongestScreenRow() + if longestScreenRow? screenRows.push(longestScreenRow) if @screenRowsToMeasure? screenRows.push(@screenRowsToMeasure...) From 1c90cbfae2bfbd4b7070eb133aadebe8d945e5b3 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 20 Nov 2015 10:45:40 -0700 Subject: [PATCH 43/84] 1.2.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cd970440d..d7787fe1e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.2.3", + "version": "1.2.4", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From 54079529ef808397bd4fa8962aebea1c2a4f7a50 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 20 Nov 2015 10:46:50 -0700 Subject: [PATCH 44/84] 1.3.0-beta6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f6686295..e00e0f10d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.3.0-beta5", + "version": "1.3.0-beta6", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From ff52f6e16cfe41f1424eb98b0014b4451c882cda Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Fri, 20 Nov 2015 18:50:36 -0500 Subject: [PATCH 45/84] :arrow_up: language-sass@0.44.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9c9afc546..d141f8c71 100644 --- a/package.json +++ b/package.json @@ -139,7 +139,7 @@ "language-python": "0.42.1", "language-ruby": "0.64.0", "language-ruby-on-rails": "0.24.0", - "language-sass": "0.44.0", + "language-sass": "0.44.1", "language-shellscript": "0.20.0", "language-source": "0.9.0", "language-sql": "0.19.0", From fcab30e822e25d2c1d6e0d85c3e9bcecd224b9a5 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 20 Nov 2015 16:46:20 -0800 Subject: [PATCH 46/84] :arrow_up: text-buffer :racehorse: --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d141f8c71..cbd79970d 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.5", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" From 2c9e13a71b0e08271f97a9ffdfefdad35b1de6d0 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sat, 21 Nov 2015 19:02:47 -0500 Subject: [PATCH 47/84] :arrow_up: language-c@0.50.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cbd79970d..b22887bf0 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "welcome": "0.33.0", "whitespace": "0.32.1", "wrap-guide": "0.38.1", - "language-c": "0.49.0", + "language-c": "0.50.0", "language-clojure": "0.18.0", "language-coffee-script": "0.45.0", "language-csharp": "0.11.0", From 6e72de8bd279ac7c62d25be99664fd66458a10a7 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 22 Nov 2015 11:10:44 -0500 Subject: [PATCH 48/84] :arrow_up: language-toml@0.17.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b22887bf0..ead105a6e 100644 --- a/package.json +++ b/package.json @@ -145,7 +145,7 @@ "language-sql": "0.19.0", "language-text": "0.7.0", "language-todo": "0.27.0", - "language-toml": "0.16.0", + "language-toml": "0.17.0", "language-xml": "0.34.1", "language-yaml": "0.24.0" }, From b25ca517ac216c7b2c68805859961ff80cca7573 Mon Sep 17 00:00:00 2001 From: Daniel Hengeveld Date: Mon, 23 Nov 2015 16:29:18 +0100 Subject: [PATCH 49/84] :arrow_up:apm@1.5.0 - required for https://github.com/atom/package-generator/issues/14 --- apm/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apm/package.json b/apm/package.json index d6ec869c3..b8dda21ea 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.4.1" + "atom-package-manager": "1.5.0" } } From 35859500ed282b4975dffdcdcad66bf7aad3bd26 Mon Sep 17 00:00:00 2001 From: Ivan Zuzak Date: Mon, 23 Nov 2015 17:32:50 +0100 Subject: [PATCH 50/84] Use enhancement instead of feature --- CONTRIBUTING.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f26ec9ab..b0f3a8a2e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ These are just guidelines, not rules, use your best judgment and feel free to pr [How Can I Contribute?](#how-can-i-contribute) * [Reporting Bugs](#reporting-bugs) - * [Suggesting Features](#suggesting-features) + * [Suggesting Enhancements](#suggesting-enhancements) * [Your First Code Contribution](#your-first-code-contribution) * [Pull Requests](#pull-requests) @@ -158,38 +158,38 @@ Include details about your configuration and environment: * Problem can be reliably reproduced, doesn't happen randomly: [Yes/No] * Problem happens with all files and projects, not only some files or projects: [Yes/No] -### Suggesting Features +### Suggesting Enhancements -This section guides you through submitting a feature suggestion for Atom. Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions :mag_right:. +This section guides you through submitting an enhancement suggestion for Atom, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion :pencil: and find related suggestions :mag_right:. -Before creating feature suggestions, please check [this list](#before-submitting-a-feature-suggestion) as you might find out that you don't need to create one. When you are creating a feature suggestion, please [include as many details as possible](#how-do-i-submit-a-good-feature-suggestion). If you'd like, you can use [this template](#template-for-submitting-feature-suggestions) to structure the information. +Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). If you'd like, you can use [this template](#template-for-submitting-enhancement-suggestions) to structure the information. -#### Before Submitting A Feature Suggestion +#### Before Submitting An Enhancement Suggestion -* **Check the [debugging guide](https://atom.io/docs/latest/hacking-atom-debugging)** for tips — you might discover that the feature is already available. Most importantly, check if you're using [the latest version of Atom](https://atom.io/docs/latest/hacking-atom-debugging#update-to-the-latest-version) and if you can get the desired behavior by changing [Atom's or packages' config settings](https://atom.io/docs/latest/hacking-atom-debugging#check-atom-and-package-settings). -* **Check if there's already [a package](https://atom.io/packages) which provides that feature.** -* **Determine [which repository the feature should be suggested in](#atom-and-packages).** -* **Perform a [cursory search](https://github.com/issues?q=+is%3Aissue+user%3Aatom)** to see if the feature has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. +* **Check the [debugging guide](https://atom.io/docs/latest/hacking-atom-debugging)** for tips — you might discover that the enhancement is already available. Most importantly, check if you're using [the latest version of Atom](https://atom.io/docs/latest/hacking-atom-debugging#update-to-the-latest-version) and if you can get the desired behavior by changing [Atom's or packages' config settings](https://atom.io/docs/latest/hacking-atom-debugging#check-atom-and-package-settings). +* **Check if there's already [a package](https://atom.io/packages) which provides that enhancement.** +* **Determine [which repository the enhancement should be suggested in](#atom-and-packages).** +* **Perform a [cursory search](https://github.com/issues?q=+is%3Aissue+user%3Aatom)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. -#### How Do I Submit A (Good) Feature Suggestion? +#### How Do I Submit A (Good) Enhancement Suggestion? -Feature suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined [which repository](#atom-and-packages) your feature suggestions is related to, create an issue on that repository and provide the following information: +Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've determined [which repository](#atom-and-packages) your enhancement suggestions is related to, create an issue on that repository and provide the following information: * **Use a clear and descriptive title** for the issue to identify the suggestion. -* **Provide a step-by-step description of the suggested feature** in as many details as possible. +* **Provide a step-by-step description of the suggested enhancement** in as many details as possible. * **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). * **Describe the current behavior** and **explain which behavior you expected to see instead** and why. * **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part of Atom which the suggestion is related to. You can use [this tool](http://www.cockos.com/licecap/) to record GIFs on OSX and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. -* **Explain why this feature would be useful** to most Atom users and isn't something that can or should be implemented as a [community package](#atom-and-packages). -* **List some other text editors or applications where this feature exists.** +* **Explain why this enhancement would be useful** to most Atom users and isn't something that can or should be implemented as a [community package](#atom-and-packages). +* **List some other text editors or applications where this enhancement exists.** * **Specify which version of Atom you're using.** You can get the exact version by running `atom -v` in your terminal, or by starting Atom and running the `Application: About` command from the [Command Palette](https://github.com/atom/command-palette). * **Specify the name and version of the OS you're using.** -#### Template For Submitting Feature Suggestions +#### Template For Submitting Enhancement Suggestions [Short description of suggestion] - **Steps which explain the feature** + **Steps which explain the enhancement** 1. [First Step] 2. [Second Step] @@ -199,15 +199,15 @@ Feature suggestions are tracked as [GitHub issues](https://guides.github.com/fea [Describe current and suggested behavior here] - **Why would the feature be useful to most users** + **Why would the enhancement be useful to most users** - [Explain why the feature would be useful to most users] + [Explain why the enhancement would be useful to most users] - [List some other text editors or applications where this feature exists] + [List some other text editors or applications where this enhancement exists] **Screenshots and GIFs** - ![Screenshots and GIFs which demonstrate the steps or part of Atom the feature suggestion is related to](url) + ![Screenshots and GIFs which demonstrate the steps or part of Atom the enhancement suggestion is related to](url) **Atom Version:** [Enter Atom version here] **OS and Version:** [Enter OS name and version here] From 0df8bb9b526e6a6d301575cc4a96dc36d48d13af Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 23 Nov 2015 17:45:14 +0100 Subject: [PATCH 51/84] :arrow_up: autocomplete-plus --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ead105a6e..b5aa01d9b 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "autocomplete-atom-api": "0.9.2", "autocomplete-css": "0.11.0", "autocomplete-html": "0.7.2", - "autocomplete-plus": "2.23.0", + "autocomplete-plus": "2.23.1", "autocomplete-snippets": "1.8.0", "autoflow": "0.26.0", "autosave": "0.23.0", From 79540f707dcea0e260ee86bf0d77a0008c717fd2 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 23 Nov 2015 11:49:50 -0700 Subject: [PATCH 52/84] :arrow_up: text-buffer and lock on specific version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b5aa01d9b..b403debec 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.5", + "text-buffer": "8.0.7", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" From 235a1a57ae78766951355d9ea2d69865087cacde Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 23 Nov 2015 11:50:56 -0700 Subject: [PATCH 53/84] Lock text-buffer to specific version Signed-off-by: Max Brunsfeld --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e00e0f10d..c2678a21a 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", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" From 3b00559992c7f094531478daa320f5fe35fea048 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 23 Nov 2015 13:50:24 -0700 Subject: [PATCH 54/84] :arrow_up: text-buffer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b403debec..51cda025b 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.7", + "text-buffer": "8.0.8", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" From 52a6e746be38cedf24ec37a787f94f2f96cf8edc Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 23 Nov 2015 15:53:37 -0500 Subject: [PATCH 55/84] :arrow_up: language-ruby@0.64.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 51cda025b..d9effbb3c 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "language-php": "0.34.0", "language-property-list": "0.8.0", "language-python": "0.42.1", - "language-ruby": "0.64.0", + "language-ruby": "0.64.1", "language-ruby-on-rails": "0.24.0", "language-sass": "0.44.1", "language-shellscript": "0.20.0", From 3b1083b874f65722a6589b34a52a920f249a8924 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 23 Nov 2015 15:53:55 -0500 Subject: [PATCH 56/84] :arrow_up: language-javascript@0.102.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d9effbb3c..a70f06ec9 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "language-html": "0.42.0", "language-hyperlink": "0.15.0", "language-java": "0.16.1", - "language-javascript": "0.102.0", + "language-javascript": "0.102.1", "language-json": "0.17.1", "language-less": "0.28.3", "language-make": "0.20.0", From d17ab332ec5d117e5849af935c9bfcaea19f828c Mon Sep 17 00:00:00 2001 From: Chen Shen Date: Mon, 23 Nov 2015 13:24:32 -0800 Subject: [PATCH 57/84] fix bug in getRawStack --- src/compile-cache.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/compile-cache.js b/src/compile-cache.js index f7726b4b3..9d5df7c96 100644 --- a/src/compile-cache.js +++ b/src/compile-cache.js @@ -159,24 +159,23 @@ require('source-map-support').install({ }) var sourceMapPrepareStackTrace = Error.prepareStackTrace -var prepareStackTrace = sourceMapPrepareStackTrace + +// Enable Grim to access the raw stack by customizing Error.prepareStackTrace +function prepareStackTraceWithRawStack (error, frames) { + error.rawStack = frames + return sourceMapPrepareStackTrace(error, frames) +} // Prevent coffee-script from reassigning Error.prepareStackTrace Object.defineProperty(Error, 'prepareStackTrace', { - get: function () { return prepareStackTrace }, + get: function () { return prepareStackTraceWithRawStack }, set: function (newValue) {} }) -// Enable Grim to access the raw stack without reassigning Error.prepareStackTrace Error.prototype.getRawStack = function () { // eslint-disable-line no-extend-native - prepareStackTrace = getRawStack - var result = this.stack - prepareStackTrace = sourceMapPrepareStackTrace - return result -} - -function getRawStack (_, stack) { - return stack + // Call this.stack first to ensure rawStack is generated + this.stack + return this.rawStack } Object.keys(COMPILERS).forEach(function (extension) { From 4616b426b09c248d1243770b0d888a27aa08e8e3 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 23 Nov 2015 15:22:15 -0800 Subject: [PATCH 58/84] Allow Error.prepareStackTrace to be temporarily reassigned Fixes https://github.com/atom/atom/issues/9660 Signed-off-by: Nathan Sobo --- spec/compile-cache-spec.coffee | 12 ++++++++++++ src/compile-cache.js | 11 +++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/spec/compile-cache-spec.coffee b/spec/compile-cache-spec.coffee index d80e05fc5..0ceb1c76b 100644 --- a/spec/compile-cache-spec.coffee +++ b/spec/compile-cache-spec.coffee @@ -69,3 +69,15 @@ describe 'CompileCache', -> CompileCache.addPathToCache(path.join(fixtures, 'cson.cson'), atomHome) expect(CSONParser.parse.callCount).toBe 1 + + describe 'overriding Error.prepareStackTrace', -> + it 'removes the override on the next tick', -> + Error.prepareStackTrace = -> 'a-stack-trace' + + error = new Error("Oops") + expect(error.stack).toBe 'a-stack-trace' + + waits(1) + runs -> + error = new Error("Oops again") + expect(error.stack).not.toBe 'a-stack-trace' diff --git a/src/compile-cache.js b/src/compile-cache.js index 9d5df7c96..81ade6ac0 100644 --- a/src/compile-cache.js +++ b/src/compile-cache.js @@ -166,10 +166,17 @@ function prepareStackTraceWithRawStack (error, frames) { return sourceMapPrepareStackTrace(error, frames) } +let prepareStackTrace = prepareStackTraceWithRawStack + // Prevent coffee-script from reassigning Error.prepareStackTrace Object.defineProperty(Error, 'prepareStackTrace', { - get: function () { return prepareStackTraceWithRawStack }, - set: function (newValue) {} + get: function () { return prepareStackTrace }, + set: function (newValue) { + prepareStackTrace = newValue + process.nextTick(function () { + prepareStackTrace = prepareStackTraceWithRawStack + }) + } }) Error.prototype.getRawStack = function () { // eslint-disable-line no-extend-native From 4bc46db3550b129a16351e628b215201c824ef10 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 23 Nov 2015 15:30:11 -0800 Subject: [PATCH 59/84] Still assign error's raw stack when prepareStackTrace is overridden Signed-off-by: Nathan Sobo --- spec/compile-cache-spec.coffee | 7 +++++-- src/compile-cache.js | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/spec/compile-cache-spec.coffee b/spec/compile-cache-spec.coffee index 0ceb1c76b..8a6cc214e 100644 --- a/spec/compile-cache-spec.coffee +++ b/spec/compile-cache-spec.coffee @@ -71,13 +71,16 @@ describe 'CompileCache', -> expect(CSONParser.parse.callCount).toBe 1 describe 'overriding Error.prepareStackTrace', -> - it 'removes the override on the next tick', -> + it 'removes the override on the next tick, and always assigns the raw stack', -> Error.prepareStackTrace = -> 'a-stack-trace' error = new Error("Oops") expect(error.stack).toBe 'a-stack-trace' + expect(Array.isArray(error.getRawStack())).toBe true waits(1) runs -> error = new Error("Oops again") - expect(error.stack).not.toBe 'a-stack-trace' + console.log error.stack + expect(error.stack).toContain('compile-cache-spec.coffee') + expect(Array.isArray(error.getRawStack())).toBe true diff --git a/src/compile-cache.js b/src/compile-cache.js index 81ade6ac0..bedbd2549 100644 --- a/src/compile-cache.js +++ b/src/compile-cache.js @@ -158,29 +158,31 @@ require('source-map-support').install({ } }) -var sourceMapPrepareStackTrace = Error.prepareStackTrace +var prepareStackTraceWithSourceMapping = Error.prepareStackTrace -// Enable Grim to access the raw stack by customizing Error.prepareStackTrace -function prepareStackTraceWithRawStack (error, frames) { +let prepareStackTrace = prepareStackTraceWithSourceMapping + +function prepareStackTraceWithRawStackAssignment (error, frames) { error.rawStack = frames - return sourceMapPrepareStackTrace(error, frames) + return prepareStackTrace(error, frames) } -let prepareStackTrace = prepareStackTraceWithRawStack - -// Prevent coffee-script from reassigning Error.prepareStackTrace Object.defineProperty(Error, 'prepareStackTrace', { - get: function () { return prepareStackTrace }, + get: function () { + return prepareStackTraceWithRawStackAssignment + }, + set: function (newValue) { prepareStackTrace = newValue process.nextTick(function () { - prepareStackTrace = prepareStackTraceWithRawStack + prepareStackTrace = prepareStackTraceWithSourceMapping }) } }) Error.prototype.getRawStack = function () { // eslint-disable-line no-extend-native - // Call this.stack first to ensure rawStack is generated + // Access this.stack to ensure prepareStackTrace has been run on this error + // because it assigns this.rawStack as a side-effect this.stack return this.rawStack } From 68a7435b6e9bdf1ae8b16ff7fe6dc9144a0af732 Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 24 Nov 2015 09:53:28 +0900 Subject: [PATCH 60/84] :arrow_up: one-dark/light-ui@v1.1.6 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a70f06ec9..ac26a51a8 100644 --- a/package.json +++ b/package.json @@ -64,10 +64,10 @@ "atom-light-ui": "0.43.0", "base16-tomorrow-dark-theme": "1.0.0", "base16-tomorrow-light-theme": "1.0.0", - "one-dark-ui": "1.1.5", + "one-dark-ui": "1.1.6", "one-dark-syntax": "1.1.1", "one-light-syntax": "1.1.1", - "one-light-ui": "1.1.5", + "one-light-ui": "1.1.6", "solarized-dark-syntax": "0.39.0", "solarized-light-syntax": "0.23.0", "about": "1.1.0", From 5fa2a6b52d83d1d3d220709a49f2e0cfd94d7dab Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 24 Nov 2015 15:48:32 +0900 Subject: [PATCH 61/84] Use @font-size for button icons --- static/buttons.less | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/buttons.less b/static/buttons.less index bfad4dae9..42e04e414 100644 --- a/static/buttons.less +++ b/static/buttons.less @@ -32,7 +32,7 @@ height: auto; line-height: 1.3em; &.icon:before { - font-size: 12px; + font-size: @font-size - 2px; } } .btn.btn-sm, @@ -41,7 +41,7 @@ height: auto; line-height: 1.3em; &.icon:before { - font-size: 14px; + font-size: @font-size + 1px; } } .btn.btn-lg, @@ -50,6 +50,9 @@ padding: @component-padding - 2px @component-padding + 2px; height: auto; line-height: 1.3em; + &.icon:before { + font-size: @font-size + 6px; + } } .btn-group > .btn { From 0c9250663f948435b1bbf84168a9da54d2fc94b2 Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 24 Nov 2015 18:13:05 +0900 Subject: [PATCH 62/84] :arrow_up: one-dark/light-ui@v1.1.7 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ac26a51a8..62a02b011 100644 --- a/package.json +++ b/package.json @@ -64,10 +64,10 @@ "atom-light-ui": "0.43.0", "base16-tomorrow-dark-theme": "1.0.0", "base16-tomorrow-light-theme": "1.0.0", - "one-dark-ui": "1.1.6", + "one-dark-ui": "1.1.7", "one-dark-syntax": "1.1.1", "one-light-syntax": "1.1.1", - "one-light-ui": "1.1.6", + "one-light-ui": "1.1.7", "solarized-dark-syntax": "0.39.0", "solarized-light-syntax": "0.23.0", "about": "1.1.0", From 9655d8184e3e6beb5c556a02741443e0f1790e50 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 11:43:09 +0100 Subject: [PATCH 63/84] Interact with DevTools asynchronously --- src/application-delegate.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index 1e05b3dbb..e76183957 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -66,13 +66,13 @@ class ApplicationDelegate ipc.send("call-window-method", "setFullScreen", fullScreen) openWindowDevTools: -> - remote.getCurrentWindow().openDevTools() + ipc.send("call-window-method", "openDevTools") toggleWindowDevTools: -> - remote.getCurrentWindow().toggleDevTools() + ipc.send("call-window-method", "toggleDevTools") executeJavaScriptInWindowDevTools: (code) -> - remote.getCurrentWindow().executeJavaScriptInDevTools(code) + ipc.send("call-window-method", "executeJavaScriptInDevTools", code) setWindowDocumentEdited: (edited) -> ipc.send("call-window-method", "setDocumentEdited", edited) From 9e931b15c31969070396bb50ef156023acb0577b Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 12:21:16 +0100 Subject: [PATCH 64/84] Switch to a Promise-based version of DevTools interaction --- src/application-delegate.coffee | 20 ++++++++++++++++++-- src/atom-environment.coffee | 8 ++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index e76183957..04fa5d2a9 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -66,10 +66,26 @@ class ApplicationDelegate ipc.send("call-window-method", "setFullScreen", fullScreen) openWindowDevTools: -> - ipc.send("call-window-method", "openDevTools") + if remote.getCurrentWindow().isDevToolsOpened() + Promise.resolve() + else + new Promise (resolve) -> + remote.getCurrentWindow().once("devtools-opened", -> resolve()) + ipc.send("call-window-method", "openDevTools") + + closeWindowDevTools: -> + unless remote.getCurrentWindow().isDevToolsOpened() + Promise.resolve() + else + new Promise (resolve) -> + remote.getCurrentWindow().once("devtools-closed", -> resolve()) + ipc.send("call-window-method", "closeDevTools") toggleWindowDevTools: -> - ipc.send("call-window-method", "toggleDevTools") + if remote.getCurrentWindow().isDevToolsOpened() + @closeWindowDevTools() + else + @openWindowDevTools() executeJavaScriptInWindowDevTools: (code) -> ipc.send("call-window-method", "executeJavaScriptInDevTools", code) diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index ac76daf04..125d0310e 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -670,8 +670,7 @@ class AtomEnvironment extends Model @emitter.emit 'will-throw-error', eventObject if openDevTools - @openDevTools() - @executeJavaScriptInDevTools('DevToolsAPI.showConsole()') + @openDevTools().then => @executeJavaScriptInDevTools('DevToolsAPI.showConsole()') @emitter.emit 'did-throw-error', {message, url, line, column, originalError} @@ -721,10 +720,15 @@ class AtomEnvironment extends Model ### # Extended: Open the dev tools for the current window. + # + # Returns a {Promise} that resolves when the DevTools have been opened. openDevTools: -> @applicationDelegate.openWindowDevTools() # Extended: Toggle the visibility of the dev tools for the current window. + # + # Returns a {Promise} that resolves when the DevTools have been opened or + # closed. toggleDevTools: -> @applicationDelegate.toggleWindowDevTools() From 93767389189c9d3be08ee7451bd9a44610345b06 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 12:28:31 +0100 Subject: [PATCH 65/84] Make spec async because of Promise-based API --- spec/atom-environment-spec.coffee | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spec/atom-environment-spec.coffee b/spec/atom-environment-spec.coffee index 3e6536681..fd43a9616 100644 --- a/spec/atom-environment-spec.coffee +++ b/spec/atom-environment-spec.coffee @@ -45,9 +45,11 @@ describe "AtomEnvironment", -> expect(atom.config.get('editor.showInvisibles')).toBe false describe "window onerror handler", -> + devToolsPromise = null beforeEach -> - spyOn atom, 'openDevTools' - spyOn atom, 'executeJavaScriptInDevTools' + devToolsPromise = Promise.resolve() + spyOn(atom, 'openDevTools').andReturn(devToolsPromise) + spyOn(atom, 'executeJavaScriptInDevTools') it "will open the dev tools when an error is triggered", -> try @@ -55,8 +57,10 @@ describe "AtomEnvironment", -> catch e window.onerror.call(window, e.toString(), 'abc', 2, 3, e) - expect(atom.openDevTools).toHaveBeenCalled() - expect(atom.executeJavaScriptInDevTools).toHaveBeenCalled() + waitsForPromise -> devToolsPromise + runs -> + expect(atom.openDevTools).toHaveBeenCalled() + expect(atom.executeJavaScriptInDevTools).toHaveBeenCalled() describe "::onWillThrowError", -> willThrowSpy = null From 6b5ef9a0aa98bd52b01144981ea1cb971ddb001e Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 12:43:30 +0100 Subject: [PATCH 66/84] :fire: --- src/application-delegate.coffee | 13 +------------ src/atom-environment.coffee | 3 --- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index 04fa5d2a9..ee3c636da 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -73,19 +73,8 @@ class ApplicationDelegate remote.getCurrentWindow().once("devtools-opened", -> resolve()) ipc.send("call-window-method", "openDevTools") - closeWindowDevTools: -> - unless remote.getCurrentWindow().isDevToolsOpened() - Promise.resolve() - else - new Promise (resolve) -> - remote.getCurrentWindow().once("devtools-closed", -> resolve()) - ipc.send("call-window-method", "closeDevTools") - toggleWindowDevTools: -> - if remote.getCurrentWindow().isDevToolsOpened() - @closeWindowDevTools() - else - @openWindowDevTools() + ipc.send("call-window-method", "toggleDevTools") executeJavaScriptInWindowDevTools: (code) -> ipc.send("call-window-method", "executeJavaScriptInDevTools", code) diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index 125d0310e..c14e95420 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -726,9 +726,6 @@ class AtomEnvironment extends Model @applicationDelegate.openWindowDevTools() # Extended: Toggle the visibility of the dev tools for the current window. - # - # Returns a {Promise} that resolves when the DevTools have been opened or - # closed. toggleDevTools: -> @applicationDelegate.toggleWindowDevTools() From b3738cfc3434e06f246868ef1f324dcbdf3e14d6 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 12:47:45 +0100 Subject: [PATCH 67/84] Interact with DevTools on process.nextTick Using any of the DevTools synchronous methods causes the bad character input issue. --- src/application-delegate.coffee | 29 ++++++++++++++++++++++------- src/atom-environment.coffee | 3 +++ 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index ee3c636da..52e08e648 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -66,15 +66,30 @@ class ApplicationDelegate ipc.send("call-window-method", "setFullScreen", fullScreen) openWindowDevTools: -> - if remote.getCurrentWindow().isDevToolsOpened() - Promise.resolve() - else - new Promise (resolve) -> - remote.getCurrentWindow().once("devtools-opened", -> resolve()) - ipc.send("call-window-method", "openDevTools") + new Promise (resolve) -> + process.nextTick -> + if remote.getCurrentWindow().isDevToolsOpened() + resolve() + else + remote.getCurrentWindow().once("devtools-opened", -> resolve()) + ipc.send("call-window-method", "openDevTools") + + closeWindowDevTools: -> + new Promise (resolve) -> + process.nextTick -> + unless remote.getCurrentWindow().isDevToolsOpened() + resolve() + else + remote.getCurrentWindow().once("devtools-closed", -> resolve()) + ipc.send("call-window-method", "closeDevTools") toggleWindowDevTools: -> - ipc.send("call-window-method", "toggleDevTools") + new Promise (resolve) => + process.nextTick => + if remote.getCurrentWindow().isDevToolsOpened() + @closeWindowDevTools().then(resolve) + else + @openWindowDevTools().then(resolve) executeJavaScriptInWindowDevTools: (code) -> ipc.send("call-window-method", "executeJavaScriptInDevTools", code) diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index c14e95420..125d0310e 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -726,6 +726,9 @@ class AtomEnvironment extends Model @applicationDelegate.openWindowDevTools() # Extended: Toggle the visibility of the dev tools for the current window. + # + # Returns a {Promise} that resolves when the DevTools have been opened or + # closed. toggleDevTools: -> @applicationDelegate.toggleWindowDevTools() From 972d483dc2d76fdc6c9d49204fda1eb29db1ce63 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 13:53:36 +0100 Subject: [PATCH 68/84] :arrow_up: metrics --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 62a02b011..2399aef75 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "line-ending-selector": "0.3.0", "link": "0.31.0", "markdown-preview": "0.156.2", - "metrics": "0.53.0", + "metrics": "0.53.1", "notifications": "0.62.1", "open-on-github": "0.40.0", "package-generator": "0.41.0", From 7bd62790d2ea80ad9d06c67717fdc0da896fadad Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 14:02:34 +0100 Subject: [PATCH 69/84] :memo: --- src/application-delegate.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index 52e08e648..d6937f2d3 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -67,6 +67,9 @@ class ApplicationDelegate openWindowDevTools: -> new Promise (resolve) -> + # Defer DevTools interaction to the next tick, because using them during + # event handling causes some wrong input events to be triggered on + # `TextEditorComponent` (Ref.: https://github.com/atom/atom/issues/9697). process.nextTick -> if remote.getCurrentWindow().isDevToolsOpened() resolve() @@ -76,6 +79,9 @@ class ApplicationDelegate closeWindowDevTools: -> new Promise (resolve) -> + # Defer DevTools interaction to the next tick, because using them during + # event handling causes some wrong input events to be triggered on + # `TextEditorComponent` (Ref.: https://github.com/atom/atom/issues/9697). process.nextTick -> unless remote.getCurrentWindow().isDevToolsOpened() resolve() @@ -85,6 +91,9 @@ class ApplicationDelegate toggleWindowDevTools: -> new Promise (resolve) => + # Defer DevTools interaction to the next tick, because using them during + # event handling causes some wrong input events to be triggered on + # `TextEditorComponent` (Ref.: https://github.com/atom/atom/issues/9697). process.nextTick => if remote.getCurrentWindow().isDevToolsOpened() @closeWindowDevTools().then(resolve) From 282ad4cb7ef1b82822ff31f318213c27f4664681 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 24 Nov 2015 06:41:22 -0700 Subject: [PATCH 70/84] :arrow_up: text-buffer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 62a02b011..8ad12571e 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.8", + "text-buffer": "8.0.9", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" From 8dbb9cfd557830fda06b57206aa36a6fef0cf6d3 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 16:24:51 +0100 Subject: [PATCH 71/84] Use CommandRegistry to listen for native-key-bindings --- src/window-event-handler.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/window-event-handler.coffee b/src/window-event-handler.coffee index c786f7e9c..d3a231f77 100644 --- a/src/window-event-handler.coffee +++ b/src/window-event-handler.coffee @@ -42,9 +42,8 @@ class WindowEventHandler # `.native-key-bindings` class. handleNativeKeybindings: -> bindCommandToAction = (command, action) => - @addEventListener @document, command, (event) => - if event.target.webkitMatchesSelector('.native-key-bindings') - @applicationDelegate.getCurrentWindow().webContents[action]() + @subscriptions.add @atomEnvironment.commands.add '.native-key-bindings', command, (event) => + @applicationDelegate.getCurrentWindow().webContents[action]() bindCommandToAction('core:copy', 'copy') bindCommandToAction('core:paste', 'paste') From c061b27076be5480dc6141e2180886b0ae604bdf Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 17:36:44 +0100 Subject: [PATCH 72/84] :white_check_mark: --- spec/window-event-handler-spec.coffee | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/spec/window-event-handler-spec.coffee b/spec/window-event-handler-spec.coffee index 3148942b4..a988ae7de 100644 --- a/spec/window-event-handler-spec.coffee +++ b/spec/window-event-handler-spec.coffee @@ -200,3 +200,34 @@ describe "WindowEventHandler", -> expect(dispatchedCommands.length).toBe 1 expect(dispatchedCommands[0].type).toBe 'foo-command' + + describe "native key bindings", -> + it "correctly dispatches them to active elements with the '.native-key-bindings' class", -> + webContentsSpy = jasmine.createSpyObj("webContents", ["copy", "paste"]) + spyOn(atom.applicationDelegate, "getCurrentWindow").andReturn({ + webContents: webContentsSpy + }) + + nativeKeyBindingsInput = document.createElement("input") + nativeKeyBindingsInput.classList.add("native-key-bindings") + jasmine.attachToDOM(nativeKeyBindingsInput) + nativeKeyBindingsInput.focus() + + atom.dispatchApplicationMenuCommand("core:copy") + atom.dispatchApplicationMenuCommand("core:paste") + + expect(webContentsSpy.copy).toHaveBeenCalled() + expect(webContentsSpy.paste).toHaveBeenCalled() + + webContentsSpy.copy.reset() + webContentsSpy.paste.reset() + + normalInput = document.createElement("input") + jasmine.attachToDOM(normalInput) + normalInput.focus() + + atom.dispatchApplicationMenuCommand("core:copy") + atom.dispatchApplicationMenuCommand("core:paste") + + expect(webContentsSpy.copy).not.toHaveBeenCalled() + expect(webContentsSpy.paste).not.toHaveBeenCalled() From 6493673d18eb340085cbfc4fa19d6eeb95478fca Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 17:49:44 +0100 Subject: [PATCH 73/84] :arrow_up: electron 0.34.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ffc69221..98c575abd 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.4", "dependencies": { "async": "0.2.6", "atom-keymap": "^6.1.1", From b101e57394795a5d878cd2b68d272021d7d0a76e Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 24 Nov 2015 11:45:32 -0700 Subject: [PATCH 74/84] Add to release notes --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4e2254d0..84ec5e13b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,3 +4,7 @@ See https://atom.io/releases * 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. From 9c43702339d3a65e174feabb0afa7f72990bbacf Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 24 Nov 2015 12:05:07 -0700 Subject: [PATCH 75/84] Add to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84ec5e13b..220b5152f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,3 +8,4 @@ See https://atom.io/releases * 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. From 4977b6180e1e09a82e37980765d068081f5ac7ac Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Tue, 24 Nov 2015 15:35:26 -0500 Subject: [PATCH 76/84] :arrow_up: language-css@0.35.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ffc69221..9d07572ba 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "language-clojure": "0.18.0", "language-coffee-script": "0.45.0", "language-csharp": "0.11.0", - "language-css": "0.35.0", + "language-css": "0.35.1", "language-gfm": "0.81.0", "language-git": "0.10.0", "language-go": "0.40.0", From f159e81de2d6ea63c2da0048e3dfde6990dc4e9f Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Tue, 24 Nov 2015 15:36:53 -0500 Subject: [PATCH 77/84] :arrow_up: language-java@0.17.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d07572ba..99c5916b5 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "language-go": "0.40.0", "language-html": "0.42.0", "language-hyperlink": "0.15.0", - "language-java": "0.16.1", + "language-java": "0.17.0", "language-javascript": "0.102.1", "language-json": "0.17.1", "language-less": "0.28.3", From 508e8b02c328e5da7b4b3c1873ed828c6c74bef6 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 25 Nov 2015 11:02:17 +0100 Subject: [PATCH 78/84] :memo: Mention blurry font fix in CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 220b5152f..057b8bcf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,3 +9,4 @@ See https://atom.io/releases * 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 c4fa042395c2ddce968fc6d64eb25ffaa296d12f Mon Sep 17 00:00:00 2001 From: simurai Date: Thu, 26 Nov 2015 15:29:05 +0900 Subject: [PATCH 79/84] :arrow_up: language-less@v0.29.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eae11b7db..70823a0a3 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "language-java": "0.17.0", "language-javascript": "0.102.1", "language-json": "0.17.1", - "language-less": "0.28.3", + "language-less": "0.29.0", "language-make": "0.20.0", "language-mustache": "0.13.0", "language-objective-c": "0.15.0", From aca12a8dc8454868154b45f701287e724a9b3dd2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 26 Nov 2015 16:09:40 +0800 Subject: [PATCH 80/84] :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 70823a0a3..52a04e53e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", - "electronVersion": "0.34.4", + "electronVersion": "0.34.5", "dependencies": { "async": "0.2.6", "atom-keymap": "^6.1.1", From 237d80fd2c47a50b57c115f568ed2366a9a31ad5 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 26 Nov 2015 11:13:10 -0500 Subject: [PATCH 81/84] :arrow_up: language-c@0.50.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 52a04e53e..11236f142 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,7 @@ "welcome": "0.33.0", "whitespace": "0.32.1", "wrap-guide": "0.38.1", - "language-c": "0.50.0", + "language-c": "0.50.1", "language-clojure": "0.18.0", "language-coffee-script": "0.45.0", "language-csharp": "0.11.0", From 5ae2a4a7fc3cf6071dba4fce0f29a9d908a1ce65 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Thu, 26 Nov 2015 11:13:26 -0500 Subject: [PATCH 82/84] :arrow_up: language-javascript@0.102.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 11236f142..7c345fe53 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "language-html": "0.42.0", "language-hyperlink": "0.15.0", "language-java": "0.17.0", - "language-javascript": "0.102.1", + "language-javascript": "0.102.2", "language-json": "0.17.1", "language-less": "0.29.0", "language-make": "0.20.0", From f2155fa22465234999e3a92d02a00edc8e16ca35 Mon Sep 17 00:00:00 2001 From: simurai Date: Fri, 27 Nov 2015 15:16:02 +0900 Subject: [PATCH 83/84] :arrow_up: settings-view@v0.232.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c345fe53..47521c4ea 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.0", + "settings-view": "0.232.1", "snippets": "1.0.1", "spell-check": "0.63.0", "status-bar": "0.80.0", From d23a28538497cc7b6bb40874f07633b6761efa5d Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 29 Nov 2015 11:03:59 -0500 Subject: [PATCH 84/84] :arrow_up: language-coffee-script@0.46.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 47521c4ea..4eb575535 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "wrap-guide": "0.38.1", "language-c": "0.50.1", "language-clojure": "0.18.0", - "language-coffee-script": "0.45.0", + "language-coffee-script": "0.46.0", "language-csharp": "0.11.0", "language-css": "0.35.1", "language-gfm": "0.81.0",