diff --git a/package.json b/package.json index 4b89dc162..d7e05d99d 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.6", "dependencies": { "async": "0.2.6", "atom-keymap": "^6.1.0", @@ -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", 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'} 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() {} 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/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() 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", -> 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 f60f2ec97..004cfbc80 100644 --- a/src/atom-environment.coffee +++ b/src/atom-environment.coffee @@ -188,6 +188,8 @@ class AtomEnvironment extends Model @stylesElement = @styles.buildStylesElement() @document.head.appendChild(@stylesElement) + @applicationDelegate.disablePinchToZoom() + @keymaps.subscribeToFileReadFailure() @keymaps.loadBundledKeymaps() 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) diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index 592ce0c3b..16456d274 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))