From 7c681905bd81948a09b54fc6013a917852148f12 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Wed, 31 May 2017 20:04:11 -0700 Subject: [PATCH 01/10] Add keyb accelerators to file change & window state dialogs. Fixes #2928 --- src/atom-environment.coffee | 4 ++-- src/pane.coffee | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index e97b14508..53d55a9f7 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -933,8 +933,8 @@ class AtomEnvironment extends Model "Would you like to add the #{nouns} to this window, permanently discarding the saved state, " + "or open the #{nouns} in a new window, restoring the saved state?" buttons: [ - 'Open in new window and recover state' - 'Add to this window and discard state' + '&Open in new window and recover state' + '&Add to this window and discard state' ] if btn is 0 @open diff --git a/src/pane.coffee b/src/pane.coffee index 31ee92f77..e5dc022a0 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -640,7 +640,7 @@ class Pane chosen = @applicationDelegate.confirm message: message detailedMessage: "Your changes will be lost if you close this item without saving." - buttons: [saveButtonText, "Cancel", "Don't Save"] + buttons: [saveButtonText, "Cancel", "&Don't Save"] switch chosen when 0 then saveFn(item, saveError) when 1 then false From 18e3f52f74a48b1536278b33c281ce39dfa135a3 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Tue, 13 Jun 2017 13:52:09 -0700 Subject: [PATCH 02/10] Appveyor switch to Node 6.9.4 from 6.8.0 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 79f4f0cbd..236f90af9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,7 @@ environment: ATOM_DEV_RESOURCE_PATH: c:\projects\atom matrix: - - NODE_VERSION: 6.8.0 + - NODE_VERSION: 6.9.4 matrix: fast_finish: true From 68b7bf46dd051a042802b4d8b86ec7fd3b3f596e Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Tue, 11 Jul 2017 17:04:54 -0700 Subject: [PATCH 03/10] Make loadSettings a property so we can change it --- src/main-process/atom-window.coffee | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main-process/atom-window.coffee b/src/main-process/atom-window.coffee index b0b516b10..5d1add870 100644 --- a/src/main-process/atom-window.coffee +++ b/src/main-process/atom-window.coffee @@ -54,14 +54,14 @@ class AtomWindow @browserWindow = new BrowserWindow(options) @handleEvents() - loadSettings = Object.assign({}, settings) - loadSettings.appVersion = app.getVersion() - loadSettings.resourcePath = @resourcePath - loadSettings.devMode ?= false - loadSettings.safeMode ?= false - loadSettings.atomHome = process.env.ATOM_HOME - loadSettings.clearWindowState ?= false - loadSettings.initialPaths ?= + @loadSettings = Object.assign({}, settings) + @loadSettings.appVersion = app.getVersion() + @loadSettings.resourcePath = @resourcePath + @loadSettings.devMode ?= false + @loadSettings.safeMode ?= false + @loadSettings.atomHome = process.env.ATOM_HOME + @loadSettings.clearWindowState ?= false + @loadSettings.initialPaths ?= for {pathToOpen} in locationsToOpen when pathToOpen stat = fs.statSyncNoException(pathToOpen) or null if stat?.isDirectory() @@ -72,17 +72,17 @@ class AtomWindow parentDirectory else pathToOpen - loadSettings.initialPaths.sort() + @loadSettings.initialPaths.sort() # Only send to the first non-spec window created if @constructor.includeShellLoadTime and not @isSpec @constructor.includeShellLoadTime = false - loadSettings.shellLoadTime ?= Date.now() - global.shellStartTime + @loadSettings.shellLoadTime ?= Date.now() - global.shellStartTime - @representedDirectoryPaths = loadSettings.initialPaths - @env = loadSettings.env if loadSettings.env? + @representedDirectoryPaths = @loadSettings.initialPaths + @env = @loadSettings.env if @loadSettings.env? - @browserWindow.loadSettingsJSON = JSON.stringify(loadSettings) + @browserWindow.loadSettingsJSON = JSON.stringify(@loadSettings) @browserWindow.on 'window:loaded', => @disableZoom() From 269623c9baf67d81abc6cb4ecffca22cbc2f1ec2 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Tue, 11 Jul 2017 20:46:09 -0700 Subject: [PATCH 04/10] Update loadSettingsJSON when paths change, fixed #13933 --- src/main-process/atom-window.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main-process/atom-window.coffee b/src/main-process/atom-window.coffee index 5d1add870..f20239e66 100644 --- a/src/main-process/atom-window.coffee +++ b/src/main-process/atom-window.coffee @@ -309,6 +309,8 @@ class AtomWindow setRepresentedDirectoryPaths: (@representedDirectoryPaths) -> @representedDirectoryPaths.sort() + @loadSettings.initialPaths = @representedDirectoryPaths + @browserWindow.loadSettingsJSON = JSON.stringify(@loadSettings) @atomApplication.saveState() copy: -> @browserWindow.copy() From dbe75c9362858f4a35d28036b31ee2673aa1da5c Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Wed, 12 Jul 2017 15:52:08 -0700 Subject: [PATCH 05/10] Pin npm to 5.1 so we can build. 5.2 causes errors with eslinter-plugin-react --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 65e244dd4..9d972adec 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,7 +28,7 @@ matrix: install: - SET PATH=C:\Program Files\Atom\resources\cli;%PATH% - ps: Install-Product node $env:NODE_VERSION $env:PLATFORM - - npm install -g npm + - npm install -g npm@5.1 build_script: - IF NOT EXIST C:\sqtemp MKDIR C:\sqtemp From 52bfe3eee5f416bae20e41d5e9c5e443e180a03d Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Wed, 12 Jul 2017 23:48:32 -0400 Subject: [PATCH 06/10] :arrow_up: autocomplete-css@0.16.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c1ff8925d..b0670c556 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "about": "1.7.6", "archive-view": "0.63.3", "autocomplete-atom-api": "0.10.2", - "autocomplete-css": "0.16.2", + "autocomplete-css": "0.16.3", "autocomplete-html": "0.8.0", "autocomplete-plus": "2.35.7", "autocomplete-snippets": "1.11.0", From c3f7edc104df3ad8e325fc1dbfa75a50776cc767 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 13 Jul 2017 15:11:36 +0200 Subject: [PATCH 07/10] Swap underlying editor correctly when calling setModel on editor element Previously, when `setModel` was called, we forgot to update the pointer to the component in the newly supplied editor. This was causing the element to not update in response to model updates but only as a result of focus or visibility changes. We suspect this regressed during the rewrite of the editor rendering layer. With this commit we will now correctly swap the element's underlying editor by updating the component pointer on the newly supplied editor. Also, if the element was already attached to another editor, we will null out the component reference on it, because one instance of `TextEditorElement` can only represent one instance of `TextEditor`. --- spec/text-editor-element-spec.js | 27 +++++++++++++++++++++++++++ src/text-editor-component.js | 4 ++++ 2 files changed, 31 insertions(+) diff --git a/spec/text-editor-element-spec.js b/spec/text-editor-element-spec.js index c92c6f144..a9692bc21 100644 --- a/spec/text-editor-element-spec.js +++ b/spec/text-editor-element-spec.js @@ -201,6 +201,33 @@ describe('TextEditorElement', () => { }) }) + describe('::setModel', () => { + describe('when the element does not have an editor yet', () => { + it('uses the supplied one', () => { + const element = buildTextEditorElement({attach: false}) + const editor = new TextEditor() + element.setModel(editor) + jasmine.attachToDOM(element) + expect(editor.element).toBe(element) + expect(element.getModel()).toBe(editor) + }) + }) + + describe('when the element already has an editor', () => { + it('unbinds it and then swaps it with the supplied one', async () => { + const element = buildTextEditorElement({attach: true}) + const previousEditor = element.getModel() + expect(previousEditor.element).toBe(element) + + const newEditor = new TextEditor() + element.setModel(newEditor) + expect(previousEditor.element).not.toBe(element) + expect(newEditor.element).toBe(element) + expect(element.getModel()).toBe(newEditor) + }) + }) + }) + describe('::onDidAttach and ::onDidDetach', () => it('invokes callbacks when the element is attached and detached', () => { const element = buildTextEditorElement({attach: false}) diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 037e45462..a93cbabba 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -174,6 +174,10 @@ class TextEditorComponent { } update (props) { + if (props.model !== this.props.model) { + this.props.model.component = null + props.model.component = this + } this.props = props this.scheduleUpdate() } From 1d42590a5bf8eb9e9fe69fab5eda746df2457905 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 13 Jul 2017 10:12:37 -0600 Subject: [PATCH 08/10] Force legacy scrollbars in text-editor-element-spec --- spec/text-editor-element-spec.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/text-editor-element-spec.js b/spec/text-editor-element-spec.js index a9692bc21..684d160a8 100644 --- a/spec/text-editor-element-spec.js +++ b/spec/text-editor-element-spec.js @@ -9,6 +9,10 @@ describe('TextEditorElement', () => { beforeEach(() => { jasmineContent = document.body.querySelector('#jasmine-content') + // Force scrollbars to be visible regardless of local system configuration + const scrollbarStyle = document.createElement('style') + scrollbarStyle.textContent = '::-webkit-scrollbar { -webkit-appearance: none }' + jasmine.attachToDOM(scrollbarStyle) }) function buildTextEditorElement (options = {}) { From e88e0fc55cfb260e94410b7bc63a9c527f3602e2 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Thu, 13 Jul 2017 09:22:23 -0700 Subject: [PATCH 09/10] Use npm 5.1.0 for building Atom --- .travis.yml | 2 +- appveyor.yml | 2 +- circle.yml | 2 +- script/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71accd347..790259016 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,7 +22,7 @@ install: - source /tmp/.nvm/nvm.sh - nvm install $NODE_VERSION - nvm use --delete-prefix $NODE_VERSION - - npm install -g npm + - npm install -g npm@5.1.0 - script/build --create-debian-package --create-rpm-package --compress-artifacts script: diff --git a/appveyor.yml b/appveyor.yml index 9d972adec..30b321e35 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -28,7 +28,7 @@ matrix: install: - SET PATH=C:\Program Files\Atom\resources\cli;%PATH% - ps: Install-Product node $env:NODE_VERSION $env:PLATFORM - - npm install -g npm@5.1 + - npm install -g npm@5.1.0 build_script: - IF NOT EXIST C:\sqtemp MKDIR C:\sqtemp diff --git a/circle.yml b/circle.yml index 5890c45e9..34ff7e2f8 100644 --- a/circle.yml +++ b/circle.yml @@ -18,7 +18,7 @@ dependencies: - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash - nvm install 6.9.4 - nvm use 6.9.4 - - npm install -g npm + - npm install -g npm@5.1.0 override: - script/build --code-sign --compress-artifacts diff --git a/script/package.json b/script/package.json index e5c09c286..9f1f36a4d 100644 --- a/script/package.json +++ b/script/package.json @@ -22,7 +22,7 @@ "minidump": "0.9.0", "mkdirp": "0.5.1", "normalize-package-data": "2.3.5", - "npm": "3.10.5", + "npm": "5.1.0", "passwd-user": "2.1.0", "pegjs": "0.9.0", "runas": "3.1.1", From 08e5dcf325b04f8d7229a8c906775832d1913ff6 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 13 Jul 2017 09:48:18 -0700 Subject: [PATCH 10/10] :arrow_up: find-and-replace --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b0670c556..a3f6e4b82 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "dev-live-reload": "0.47.1", "encoding-selector": "0.23.4", "exception-reporting": "0.41.4", - "find-and-replace": "0.209.1", + "find-and-replace": "0.209.2", "fuzzy-finder": "1.5.8", "github": "0.3.3", "git-diff": "1.3.6",