From 9354b865dd9df0c383b9518b52db5db7cbb82b7f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 16:06:33 +0800 Subject: [PATCH 01/14] :arrow_up: electron@0.33.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4b89dc162..3505728fa 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", - "electronVersion": "0.30.7", + "electronVersion": "0.33.1", "dependencies": { "async": "0.2.6", "atom-keymap": "^6.1.0", From 70fc6dd524afb83fee61cb3836d189358721fbe2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 12:38:44 +0800 Subject: [PATCH 02/14] registerProtocol has been deprecated --- src/browser/atom-protocol-handler.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/atom-protocol-handler.coffee b/src/browser/atom-protocol-handler.coffee index 0865f3ad8..0fda8095b 100644 --- a/src/browser/atom-protocol-handler.coffee +++ b/src/browser/atom-protocol-handler.coffee @@ -29,7 +29,7 @@ class AtomProtocolHandler # Creates the 'atom' custom protocol handler. registerAtomProtocol: -> - protocol.registerProtocol 'atom', (request) => + protocol.registerFileProtocol 'atom', (request, callback) => relativePath = path.normalize(request.url.substr(7)) if relativePath.indexOf('assets/') is 0 @@ -41,4 +41,4 @@ class AtomProtocolHandler filePath = path.join(loadPath, relativePath) break if fs.statSyncNoException(filePath).isFile?() - new protocol.RequestFileJob(filePath) + callback(filePath) From a5c9fcec2c6c2ee932b740142a2f52648959df59 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Sep 2015 12:39:24 +0800 Subject: [PATCH 03/14] Disable pinch-to-zoom, fixes #8850 --- src/atom-environment.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index f60f2ec97..813d8f531 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -1,5 +1,6 @@ crypto = require 'crypto' path = require 'path' +webFrame = require 'web-frame' _ = require 'underscore-plus' {deprecate} = require 'grim' @@ -188,6 +189,9 @@ class AtomEnvironment extends Model @stylesElement = @styles.buildStylesElement() @document.head.appendChild(@stylesElement) + # Disable pinch-to-zoom. + webFrame.setZoomLevelLimits(1, 1) + @keymaps.subscribeToFileReadFailure() @keymaps.loadBundledKeymaps() From 224f2e973f61c71926fd702da48c444c2f3873e5 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 25 Sep 2015 13:55:20 +0200 Subject: [PATCH 04/14] Adhere to `CoffeeScript.compile` contract ...which always returns the source map as a string. This is needed because `Buffer` now requires to be initialized with either a number, a buffer, an array or a string. --- spec/compile-cache-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/compile-cache-spec.coffee b/spec/compile-cache-spec.coffee index 94910bb58..d80e05fc5 100644 --- a/spec/compile-cache-spec.coffee +++ b/spec/compile-cache-spec.coffee @@ -18,7 +18,7 @@ describe 'CompileCache', -> CompileCache.resetCacheStats() spyOn(Babel, 'transform').andReturn {code: 'the-babel-code'} - spyOn(CoffeeScript, 'compile').andReturn {js: 'the-coffee-code', v3SourceMap: {}} + spyOn(CoffeeScript, 'compile').andReturn {js: 'the-coffee-code', v3SourceMap: "{}"} spyOn(TypeScriptSimple::, 'compile').andReturn 'the-typescript-code' spyOn(CSONParser, 'parse').andReturn {the: 'cson-data'} From 23d5dc872654c3bc353d0a3a24d782c30659ebbc Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 25 Sep 2015 13:59:00 +0200 Subject: [PATCH 05/14] Change invalid.js fixture for babel transpilation The previous file was considered invalid on the earlier version of electron, but it now compiles correctly because of the updated ES6 support. --- spec/fixtures/babel/invalid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/fixtures/babel/invalid.js b/spec/fixtures/babel/invalid.js index 4af6a59e2..f02fd2fd6 100644 --- a/spec/fixtures/babel/invalid.js +++ b/spec/fixtures/babel/invalid.js @@ -1,3 +1,3 @@ 'use 6to6'; -module.exports = v => v + 1 +module.exports = async function hello() {} From 0f7c85288336e38aa7b82337497758370be1312a Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sat, 26 Sep 2015 15:42:00 -0400 Subject: [PATCH 06/14] :arrow_up: electron@0.33.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3505728fa..e323e9bdd 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", - "electronVersion": "0.33.1", + "electronVersion": "0.33.3", "dependencies": { "async": "0.2.6", "atom-keymap": "^6.1.0", From 5f2b5a16dfeb340b323896b62d9fcd8e613ac91c Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 26 Sep 2015 16:38:51 -0600 Subject: [PATCH 07/14] Use WebContents.prototype.isLoading instead of defunct .loaded Fixes cmd-o interaction. --- src/browser/atom-window.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index 3be46b5fc..3cbf277ea 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -88,7 +88,7 @@ class AtomWindow hash: encodeURIComponent(JSON.stringify(loadSettings)) getLoadSettings: -> - if @browserWindow.webContents?.loaded + if @browserWindow.webContents? and not @browserWindow.webContents.isLoading() hash = url.parse(@browserWindow.webContents.getUrl()).hash.substr(1) JSON.parse(decodeURIComponent(hash)) From f0b7356ba0486c5cbbe7420c27ee23550b176444 Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Fri, 2 Oct 2015 08:48:37 +0200 Subject: [PATCH 08/14] :arrow_up: electron@0.33.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e323e9bdd..3660dab0d 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", - "electronVersion": "0.33.3", + "electronVersion": "0.33.4", "dependencies": { "async": "0.2.6", "atom-keymap": "^6.1.0", From bbf25e7da15e4759341ffad26299639a1cc788ab Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Mon, 5 Oct 2015 07:31:04 +0200 Subject: [PATCH 09/14] :arrow_up: electron@0.33.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3660dab0d..22af172ad 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", - "electronVersion": "0.33.4", + "electronVersion": "0.33.5", "dependencies": { "async": "0.2.6", "atom-keymap": "^6.1.0", From 1bfcea35b615bf59ab96ec267423cffc0d19b081 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 5 Oct 2015 15:19:35 -0400 Subject: [PATCH 10/14] :arrow_up: electron@0.33.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 22af172ad..fb600d215 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", - "electronVersion": "0.33.5", + "electronVersion": "0.33.6", "dependencies": { "async": "0.2.6", "atom-keymap": "^6.1.0", From 661607857fbeceee467d9ce9ce602f9e61eb606d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 15 Oct 2015 18:38:17 -0600 Subject: [PATCH 11/14] Fix spec failures due to slight changes in DOM positioning --- spec/lines-yardstick-spec.coffee | 16 ++++++++-------- spec/text-editor-component-spec.coffee | 12 ++++++++---- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/spec/lines-yardstick-spec.coffee b/spec/lines-yardstick-spec.coffee index 1f5a01560..022f535f4 100644 --- a/spec/lines-yardstick-spec.coffee +++ b/spec/lines-yardstick-spec.coffee @@ -76,10 +76,10 @@ describe "LinesYardstick", -> expect(linesYardstick.pixelPositionForScreenPosition([0, 0])).toEqual({left: 0, top: 0}) expect(linesYardstick.pixelPositionForScreenPosition([0, 1])).toEqual({left: 7, top: 0}) - expect(linesYardstick.pixelPositionForScreenPosition([0, 5])).toEqual({left: 37.8046875, top: 0}) - expect(linesYardstick.pixelPositionForScreenPosition([1, 6])).toEqual({left: 43.20703125, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([1, 9])).toEqual({left: 72.20703125, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([2, Infinity])).toEqual({left: 288.046875, top: 28}) + expect(linesYardstick.pixelPositionForScreenPosition([0, 5])).toEqual({left: 37.78125, top: 0}) + expect(linesYardstick.pixelPositionForScreenPosition([1, 6])).toEqual({left: 43.171875, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition([1, 9])).toEqual({left: 72.171875, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition([2, Infinity])).toEqual({left: 287.859375, top: 28}) it "reuses already computed pixel positions unless it is invalidated", -> atom.styles.addStyleSheet """ @@ -105,9 +105,9 @@ describe "LinesYardstick", -> linesYardstick.invalidateCache() - expect(linesYardstick.pixelPositionForScreenPosition([1, 2])).toEqual({left: 24.00390625, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([2, 6])).toEqual({left: 72.01171875, top: 28}) - expect(linesYardstick.pixelPositionForScreenPosition([5, 10])).toEqual({left: 120.01171875, top: 70}) + expect(linesYardstick.pixelPositionForScreenPosition([1, 2])).toEqual({left: 24, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition([2, 6])).toEqual({left: 72, top: 28}) + expect(linesYardstick.pixelPositionForScreenPosition([5, 10])).toEqual({left: 120, top: 70}) it "correctly handles RTL characters", -> atom.styles.addStyleSheet """ @@ -156,7 +156,7 @@ describe "LinesYardstick", -> expect(linesYardstick.screenPositionForPixelPosition({top: 32, left: 24.3})).toEqual([2, 3]) expect(linesYardstick.screenPositionForPixelPosition({top: 46, left: 66.5})).toEqual([3, 9]) expect(linesYardstick.screenPositionForPixelPosition({top: 80, left: 99.9})).toEqual([5, 14]) - expect(linesYardstick.screenPositionForPixelPosition({top: 80, left: 224.4365234375})).toEqual([5, 29]) + expect(linesYardstick.screenPositionForPixelPosition({top: 80, left: 224.2365234375})).toEqual([5, 29]) expect(linesYardstick.screenPositionForPixelPosition({top: 80, left: 225})).toEqual([5, 30]) it "clips pixel positions above buffer start", -> diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index b0f3ace51..91020f299 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -3482,12 +3482,14 @@ describe "TextEditorComponent", -> editor.moveRight() nextAnimationFrame() - right = wrapperNode.pixelPositionForScreenPosition([0, 6]).left + + margin = component.presenter.getHorizontalScrollMarginInPixels() + right = wrapperNode.pixelPositionForScreenPosition([0, 4]).left + margin expect(wrapperNode.getScrollRight()).toBeCloseTo right, 0 editor.moveRight() nextAnimationFrame() - right = wrapperNode.pixelPositionForScreenPosition([0, 7]).left + right = wrapperNode.pixelPositionForScreenPosition([0, 5]).left + margin expect(wrapperNode.getScrollRight()).toBeCloseTo right, 0 it "scrolls left when the last cursor gets closer than ::horizontalScrollMargin to the left of the editor", -> @@ -3499,12 +3501,14 @@ describe "TextEditorComponent", -> editor.moveLeft() nextAnimationFrame() - left = wrapperNode.pixelPositionForScreenPosition([6, 59]).left + + margin = component.presenter.getHorizontalScrollMarginInPixels() + left = wrapperNode.pixelPositionForScreenPosition([6, 61]).left - margin expect(wrapperNode.getScrollLeft()).toBeCloseTo left, 0 editor.moveLeft() nextAnimationFrame() - left = wrapperNode.pixelPositionForScreenPosition([6, 58]).left + left = wrapperNode.pixelPositionForScreenPosition([6, 60]).left - margin expect(wrapperNode.getScrollLeft()).toBeCloseTo left, 0 it "scrolls down when inserting lines makes the document longer than the editor's height", -> From badba2810e2e0ce12b6138ab273b0821c468ca87 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 15 Oct 2015 18:49:16 -0600 Subject: [PATCH 12/14] Add disablePinchToZoom to ApplicationDelegate --- src/application-delegate.coffee | 4 ++++ src/atom-environment.coffee | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index f2b425137..1999c6e83 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -2,6 +2,7 @@ _ = require 'underscore-plus' ipc = require 'ipc' remote = require 'remote' shell = require 'shell' +webFrame = require 'web-frame' {Disposable} = require 'event-kit' {getWindowLoadSettings, setWindowLoadSettings} = require './window-load-settings-helpers' @@ -163,3 +164,6 @@ class ApplicationDelegate openExternal: (url) -> shell.openExternal(url) + + disablePinchToZoom: -> + webFrame.setZoomLevelLimits(1, 1) diff --git a/src/atom-environment.coffee b/src/atom-environment.coffee index 813d8f531..004cfbc80 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -1,6 +1,5 @@ crypto = require 'crypto' path = require 'path' -webFrame = require 'web-frame' _ = require 'underscore-plus' {deprecate} = require 'grim' @@ -189,8 +188,7 @@ class AtomEnvironment extends Model @stylesElement = @styles.buildStylesElement() @document.head.appendChild(@stylesElement) - # Disable pinch-to-zoom. - webFrame.setZoomLevelLimits(1, 1) + @applicationDelegate.disablePinchToZoom() @keymaps.subscribeToFileReadFailure() @keymaps.loadBundledKeymaps() From eb2a6a3388bcaeb536730b520197b3db89aaa34a Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 16 Oct 2015 12:21:32 -0600 Subject: [PATCH 13/14] Mock process.cwd to make test pass in headless mode --- spec/module-cache-spec.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/module-cache-spec.coffee b/spec/module-cache-spec.coffee index 5cf6bd2fd..3a995aec7 100644 --- a/spec/module-cache-spec.coffee +++ b/spec/module-cache-spec.coffee @@ -86,6 +86,7 @@ describe 'ModuleCache', -> exports.load = function() { require('underscore-plus'); }; """ + spyOn(process, 'cwd').andReturn('/') # Required when running this test from CLI packageMain = require(indexPath) Module._findPath.reset() expect(-> packageMain.load()).toThrow() From 4093e6d135846a250d8b31216cff94106c69e885 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 16 Oct 2015 12:42:02 -0600 Subject: [PATCH 14/14] :arrow_up: wrap-guide --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb600d215..d7e05d99d 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "update-package-dependencies": "0.10.0", "welcome": "0.31.0", "whitespace": "0.31.0", - "wrap-guide": "0.38.0", + "wrap-guide": "0.38.1", "language-c": "0.49.0", "language-clojure": "0.18.0", "language-coffee-script": "0.42.0",