From a706a77fd99a4b20356b9a0c78b11f5a6b662dd9 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Sat, 19 Dec 2015 16:06:56 +0100 Subject: [PATCH 01/31] Add time-grunt to benchmark each task time --- build/Gruntfile.coffee | 2 ++ build/package.json | 1 + 2 files changed, 3 insertions(+) diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index 26d9c2f42..63afc2fd7 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -14,6 +14,8 @@ _ = require 'underscore-plus' packageJson = require '../package.json' module.exports = (grunt) -> + require('time-grunt')(grunt) + grunt.loadNpmTasks('grunt-babel') grunt.loadNpmTasks('grunt-coffeelint') grunt.loadNpmTasks('grunt-lesslint') diff --git a/build/package.json b/build/package.json index fd7d29d80..d5c780c08 100644 --- a/build/package.json +++ b/build/package.json @@ -37,6 +37,7 @@ "runas": "^3.1", "tello": "1.0.5", "temp": "~0.8.1", + "time-grunt": "1.2.2", "underscore-plus": "1.x", "unzip": "~0.1.9", "vm-compatibility-layer": "~0.1.0", From 4e0b2c0c21e24c3d8685e0cb16735dc291c39ef2 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Sat, 19 Dec 2015 16:20:27 +0100 Subject: [PATCH 02/31] Print package/modules (un)installation times --- script/bootstrap | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/script/bootstrap b/script/bootstrap index 8314b9cb0..5f9241a3d 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -5,8 +5,16 @@ var verifyRequirements = require('./utils/verify-requirements'); var safeExec = require('./utils/child-process-wrapper.js').safeExec; var path = require('path'); +var t0, t1 + // Executes an array of commands one by one. function executeCommands(commands, done, index) { + if (index != undefined) { + t1 = Date.now() + console.log("=> Took " + (t1 - t0) + "ms."); + console.log(); + } + index = (index == undefined ? 0 : index); if (index < commands.length) { var command = commands[index]; @@ -17,6 +25,7 @@ function executeCommands(commands, done, index) { options = command.options; command = command.command; } + t0 = Date.now() safeExec(command, options, executeCommands.bind(this, commands, done, index + 1)); } else @@ -96,7 +105,10 @@ function bootstrap() { message: 'Installing apm...', options: apmInstallOptions }, - apmPath + ' clean' + apmFlags, + { + command: apmPath + ' clean' + apmFlags, + message: 'Deleting old packages...' + }, moduleInstallCommand, dedupeApmCommand + ' ' + packagesToDedupe.join(' '), ]; From 357af1e997c376334123b37c11018a4095cc4c89 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 21 Dec 2015 08:01:22 -0500 Subject: [PATCH 03/31] :arrow_down: language-git@0.11.0 Specs need to be updated --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 72c8a14ae..8e058ae67 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "language-csharp": "0.11.0", "language-css": "0.36.0", "language-gfm": "0.82.0", - "language-git": "0.11.1", + "language-git": "0.11.0", "language-go": "0.41.0", "language-html": "0.43.1", "language-hyperlink": "0.16.0", From d094eb8ef1d0b82d5b85e7dafb39532fbb30d0a4 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 21 Dec 2015 10:39:22 -0700 Subject: [PATCH 04/31] :arrow_up: event-kit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8e058ae67..dd661ccd4 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "clear-cut": "^2.0.1", "coffee-script": "1.8.0", "color": "^0.7.3", - "event-kit": "^1.3.0", + "event-kit": "^1.5.0", "find-parent-dir": "^0.3.0", "first-mate": "^5.1.1", "fs-plus": "^2.8.0", From b7c4655c28e54f6db7ef8dbefd53bec41a11a22c Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 21 Dec 2015 17:52:31 -0500 Subject: [PATCH 05/31] :arrow_up: language-javascript@0.105.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd661ccd4..d9abfe276 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,7 @@ "language-html": "0.43.1", "language-hyperlink": "0.16.0", "language-java": "0.17.0", - "language-javascript": "0.104.0", + "language-javascript": "0.105.0", "language-json": "0.17.2", "language-less": "0.29.0", "language-make": "0.21.0", From 5d85ea18ae48c9c9fd54931630a99a4d44962a9e Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 21 Dec 2015 20:08:36 -0500 Subject: [PATCH 06/31] :arrow_up: language-php@0.36.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d9abfe276..2ac4df46b 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "language-mustache": "0.13.0", "language-objective-c": "0.15.1", "language-perl": "0.32.0", - "language-php": "0.34.0", + "language-php": "0.36.0", "language-property-list": "0.8.0", "language-python": "0.42.1", "language-ruby": "0.65.0", From 7024e000a81c1e6fb05150da9013a84abadd270e Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 30 Dec 2015 14:32:55 -0500 Subject: [PATCH 07/31] Provide some defaults. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we’ll get: TypeError: Cannot read property 'pathToOpen' of undefined when called from ‘application:new-file’. --- src/browser/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index e720597e3..c8b417386 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -370,7 +370,7 @@ class AtomApplication # :safeMode - Boolean to control the opened window's safe mode. # :profileStartup - Boolean to control creating a profile of the startup time. # :window - {AtomWindow} to open file paths in. - openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup, window}) -> + openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup, window} = {}) -> @openPaths({pathsToOpen: [pathToOpen], pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup, window}) # Public: Opens multiple paths, in existing windows if possible. From 5c14d3e99b795f045bbdbe56cd6b9adc334ca386 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 30 Dec 2015 14:33:23 -0500 Subject: [PATCH 08/31] Don't fail if `event` is undefined. Unclear why this is undefined, but apparently it is. --- src/browser/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index c8b417386..04c2d3824 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -229,7 +229,7 @@ class AtomApplication @openUrl({urlToOpen, @devMode, @safeMode}) app.on 'activate-with-no-open-windows', (event) => - event.preventDefault() + event?.preventDefault() @emit('application:new-window') # A request from the associated render process to open a new render process. From a63e70148d9a5a6d32b445c158fe07db189b46ba Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 30 Dec 2015 17:33:45 -0500 Subject: [PATCH 09/31] Cascade new windows on OS X Fixes #10057. --- src/browser/atom-application.coffee | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index e720597e3..a77591159 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -167,7 +167,7 @@ class AtomApplication safeMode: @focusedWindow()?.safeMode @on 'application:quit', -> app.quit() - @on 'application:new-window', -> @openPath(_.extend(windowDimensions: @focusedWindow()?.getDimensions(), getLoadSettings())) + @on 'application:new-window', -> @openPath(getLoadSettings()) @on 'application:new-file', -> (@focusedWindow() ? this).openPath() @on 'application:open', -> @promptForPathToOpen('all', getLoadSettings()) @on 'application:open-file', -> @promptForPathToOpen('file', getLoadSettings()) @@ -360,6 +360,15 @@ class AtomApplication focusedWindow: -> _.find @windows, (atomWindow) -> atomWindow.isFocused() + # Get the dimensions for opening a new window by cascading as appropriate. + getDimensionsForNewWindow: -> + dimensions = (@focusedWindow() ? @lastFocusedWindow)?.getDimensions() + # On OS X, new windows cascade down and to the right. + if dimensions? and process.platform is 'darwin' + dimensions.x += 20 + dimensions.y += 20 + dimensions + # Public: Opens a single path, in an existing window if possible. # # options - @@ -417,6 +426,7 @@ class AtomApplication windowInitializationScript ?= require.resolve('../initialize-application-window') resourcePath ?= @resourcePath + windowDimensions ?= @getDimensionsForNewWindow() openedWindow = new AtomWindow({locationsToOpen, windowInitializationScript, resourcePath, devMode, safeMode, windowDimensions, profileStartup}) if pidToKillWhenClosed? From 9e7cb15c2c056f99fb1f228758ef2e846549178f Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 12:05:42 -0500 Subject: [PATCH 10/31] Offset on Windows too. --- src/browser/atom-application.coffee | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index a77591159..b91adabac 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -360,13 +360,18 @@ class AtomApplication focusedWindow: -> _.find @windows, (atomWindow) -> atomWindow.isFocused() - # Get the dimensions for opening a new window by cascading as appropriate. + # Get the dimensions for opening a new window by cascading as appropriate to + # the platform. getDimensionsForNewWindow: -> - dimensions = (@focusedWindow() ? @lastFocusedWindow)?.getDimensions() - # On OS X, new windows cascade down and to the right. - if dimensions? and process.platform is 'darwin' - dimensions.x += 20 - dimensions.y += 20 + offsetByPlatform = + darwin: 22 + win32: 26 + + dimensions = @windows[@windows.length - 1]?.getDimensions() + offset = offsetByPlatform[process.platform] + if dimensions? and offset? + dimensions.x += offset + dimensions.y += offset dimensions # Public: Opens a single path, in an existing window if possible. From dcd860ae6fb4249ad20536b75618c9590425cb1d Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 12:18:48 -0500 Subject: [PATCH 11/31] Use the last focused window instead of the last opened window. --- src/browser/atom-application.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index b91adabac..fe21ae107 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -367,7 +367,7 @@ class AtomApplication darwin: 22 win32: 26 - dimensions = @windows[@windows.length - 1]?.getDimensions() + dimensions = (@focusedWindow() ? @lastFocusedWindow)?.getDimensions() offset = offsetByPlatform[process.platform] if dimensions? and offset? dimensions.x += offset From b25e7f025ca028006a2bfb58ea3d4e443e0aaa22 Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 14:46:16 -0500 Subject: [PATCH 12/31] :arrow_up: git-utils@4.0.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2ac4df46b..927af044e 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "fs-plus": "^2.8.0", "fstream": "0.1.24", "fuzzaldrin": "^2.1", - "git-utils": "^4.0.7", + "git-utils": "^4.0.8", "grim": "1.5.0", "jasmine-json": "~0.0", "jasmine-tagged": "^1.1.4", From b4035547c27beb24dda28d2d6ba127448c24eae2 Mon Sep 17 00:00:00 2001 From: joshaber Date: Fri, 1 Jan 2016 17:05:50 -0500 Subject: [PATCH 13/31] Use .getStatusForPaths. --- src/git-repository.coffee | 6 +++++- src/repository-status-handler.coffee | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/git-repository.coffee b/src/git-repository.coffee index 1663f9ad4..ee27f87a5 100644 --- a/src/git-repository.coffee +++ b/src/git-repository.coffee @@ -463,8 +463,12 @@ class GitRepository refreshStatus: -> @handlerPath ?= require.resolve('./repository-status-handler') + relativeProjectPaths = @project?.getPaths() + .map (path) => @relativize(path) + .filter (path) -> path.length > 0 + @statusTask?.terminate() - @statusTask = Task.once @handlerPath, @getPath(), ({statuses, upstream, branch, submodules}) => + @statusTask = Task.once @handlerPath, @getPath(), relativeProjectPaths, ({statuses, upstream, branch, submodules}) => statusesUnchanged = _.isEqual(statuses, @statuses) and _.isEqual(upstream, @upstream) and _.isEqual(branch, @branch) and diff --git a/src/repository-status-handler.coffee b/src/repository-status-handler.coffee index d0763fd5a..2fda9a335 100644 --- a/src/repository-status-handler.coffee +++ b/src/repository-status-handler.coffee @@ -1,7 +1,7 @@ Git = require 'git-utils' path = require 'path' -module.exports = (repoPath) -> +module.exports = (repoPath, paths = []) -> repo = Git.open(repoPath) upstream = {} @@ -12,7 +12,8 @@ module.exports = (repoPath) -> if repo? # Statuses in main repo workingDirectoryPath = repo.getWorkingDirectory() - for filePath, status of repo.getStatus() + repoStatus = (if paths.length > 0 then repo.getStatusForPaths(paths) else repo.getStatus()) + for filePath, status of repoStatus statuses[filePath] = status # Statuses in submodules From 876928f7f6bfd3670496f4e4dc91d94aab9540b8 Mon Sep 17 00:00:00 2001 From: Kevin J Date: Sat, 2 Jan 2016 16:05:21 -0500 Subject: [PATCH 14/31] Update function documentation for scrollToScreenPosition --- src/text-editor.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 1435aef19..91b1409a4 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -3037,7 +3037,7 @@ class TextEditor extends Model # Essential: Scrolls the editor to the given screen position. # - # * `screenPosition` An object that represents a buffer position. It can be either + # * `screenPosition` An object that represents a screen position. It can be either # an {Object} (`{row, column}`), {Array} (`[row, column]`), or {Point} # * `options` (optional) {Object} # * `center` Center the editor around the position if possible. (default: false) From c1c67b682ccb7a7a71b404ad9ba4a4694d2c4f11 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 3 Jan 2016 18:58:51 -0500 Subject: [PATCH 15/31] :arrow_up: language-ruby@0.66.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 927af044e..73ba84ba7 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "language-php": "0.36.0", "language-property-list": "0.8.0", "language-python": "0.42.1", - "language-ruby": "0.65.0", + "language-ruby": "0.66.0", "language-ruby-on-rails": "0.24.0", "language-sass": "0.45.0", "language-shellscript": "0.21.0", From 31030275a8cda213d2021486f5299da0eba8e22d Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sun, 3 Jan 2016 18:59:11 -0500 Subject: [PATCH 16/31] :arrow_up: language-ruby-on-rails@0.25.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 73ba84ba7..0ad2ffae9 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "language-property-list": "0.8.0", "language-python": "0.42.1", "language-ruby": "0.66.0", - "language-ruby-on-rails": "0.24.0", + "language-ruby-on-rails": "0.25.0", "language-sass": "0.45.0", "language-shellscript": "0.21.0", "language-source": "0.9.0", From ab3cb1778a74f8e06ae31664e07927bdfca2652f Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Mon, 4 Jan 2016 09:40:54 -0500 Subject: [PATCH 17/31] :arrow_up: language-ruby@0.67.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0ad2ffae9..f6c38b9c8 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "language-php": "0.36.0", "language-property-list": "0.8.0", "language-python": "0.42.1", - "language-ruby": "0.66.0", + "language-ruby": "0.67.0", "language-ruby-on-rails": "0.25.0", "language-sass": "0.45.0", "language-shellscript": "0.21.0", From 6ee36b14b1774583f7d5305ea74edc945f0a3fa7 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 4 Jan 2016 09:58:19 -0800 Subject: [PATCH 18/31] Prepare 1.3.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5710de92d..959be0793 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "1.3.2", + "version": "1.3.3", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From ba24364a89c2a0427e8fda270af768d54d667a35 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 4 Jan 2016 09:58:29 -0800 Subject: [PATCH 19/31] :arrow_up: text-buffer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 959be0793..1cb27543a 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-hotfix.1", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0" From a962bba3a1299a7e27955c3c63dd3a16af4418ce Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 4 Jan 2016 16:24:47 -0500 Subject: [PATCH 20/31] :arrow_up: git-utils@4.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f6c38b9c8..591e1a2a0 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "fs-plus": "^2.8.0", "fstream": "0.1.24", "fuzzaldrin": "^2.1", - "git-utils": "^4.0.8", + "git-utils": "^4.1.0", "grim": "1.5.0", "jasmine-json": "~0.0", "jasmine-tagged": "^1.1.4", From 9f6fbacddd8d4fb51e24b3b79d9a709d1bdaa0ad Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 4 Jan 2016 16:32:38 -0700 Subject: [PATCH 21/31] =?UTF-8?q?Don=E2=80=99t=20clip=20screen=20positions?= =?UTF-8?q?=20in=20yardstick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By clipping positions only in the TextEditorComponent, we can ensure that we check for the presence of a rendered line for the clipped row value. --- spec/fake-lines-yardstick.coffee | 3 +- spec/lines-yardstick-spec.coffee | 51 ++++++++++++++++---------------- src/lines-yardstick.coffee | 5 +--- src/text-editor-component.coffee | 7 +++-- src/text-editor-presenter.coffee | 22 +++++++------- 5 files changed, 45 insertions(+), 43 deletions(-) diff --git a/spec/fake-lines-yardstick.coffee b/spec/fake-lines-yardstick.coffee index da5f8327e..a2568b959 100644 --- a/spec/fake-lines-yardstick.coffee +++ b/spec/fake-lines-yardstick.coffee @@ -19,9 +19,8 @@ class FakeLinesYardstick setScopedCharacterWidth: (scopeNames, character, width) -> @getScopedCharacterWidths(scopeNames)[character] = width - pixelPositionForScreenPosition: (screenPosition, clip=true) -> + pixelPositionForScreenPosition: (screenPosition) -> screenPosition = Point.fromObject(screenPosition) - screenPosition = @model.clipScreenPosition(screenPosition) if clip targetRow = screenPosition.row targetColumn = screenPosition.column diff --git a/spec/lines-yardstick-spec.coffee b/spec/lines-yardstick-spec.coffee index 74f5fca6a..3520d6935 100644 --- a/spec/lines-yardstick-spec.coffee +++ b/spec/lines-yardstick-spec.coffee @@ -1,5 +1,6 @@ LinesYardstick = require "../src/lines-yardstick" {toArray} = require 'underscore-plus' +{Point} = require 'text-buffer' describe "LinesYardstick", -> [editor, mockLineNodesProvider, createdLineNodes, linesYardstick, buildLineNode] = [] @@ -62,12 +63,12 @@ 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.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}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 0))).toEqual({left: 0, top: 0}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 1))).toEqual({left: 7, top: 0}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 5))).toEqual({left: 37.78125, top: 0}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 6))).toEqual({left: 43.171875, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 9))).toEqual({left: 72.171875, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(2, Infinity))).toEqual({left: 287.859375, top: 28}) it "reuses already computed pixel positions unless it is invalidated", -> atom.styles.addStyleSheet """ @@ -77,9 +78,9 @@ describe "LinesYardstick", -> } """ - expect(linesYardstick.pixelPositionForScreenPosition([1, 2])).toEqual({left: 19.203125, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([2, 6])).toEqual({left: 57.609375, top: 28}) - expect(linesYardstick.pixelPositionForScreenPosition([5, 10])).toEqual({left: 95.609375, top: 70}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 2))).toEqual({left: 19.203125, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(2, 6))).toEqual({left: 57.609375, top: 28}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(5, 10))).toEqual({left: 95.609375, top: 70}) atom.styles.addStyleSheet """ * { @@ -87,15 +88,15 @@ describe "LinesYardstick", -> } """ - expect(linesYardstick.pixelPositionForScreenPosition([1, 2])).toEqual({left: 19.203125, top: 14}) - expect(linesYardstick.pixelPositionForScreenPosition([2, 6])).toEqual({left: 57.609375, top: 28}) - expect(linesYardstick.pixelPositionForScreenPosition([5, 10])).toEqual({left: 95.609375, top: 70}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 2))).toEqual({left: 19.203125, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(2, 6))).toEqual({left: 57.609375, top: 28}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(5, 10))).toEqual({left: 95.609375, top: 70}) linesYardstick.invalidateCache() - 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}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(1, 2))).toEqual({left: 24, top: 14}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(2, 6))).toEqual({left: 72, top: 28}) + expect(linesYardstick.pixelPositionForScreenPosition(Point(5, 10))).toEqual({left: 120, top: 70}) it "correctly handles RTL characters", -> atom.styles.addStyleSheet """ @@ -106,13 +107,13 @@ describe "LinesYardstick", -> """ editor.setText("السلام عليكم") - expect(linesYardstick.pixelPositionForScreenPosition([0, 0]).left).toBe 0 - expect(linesYardstick.pixelPositionForScreenPosition([0, 1]).left).toBe 8 - expect(linesYardstick.pixelPositionForScreenPosition([0, 2]).left).toBe 16 - expect(linesYardstick.pixelPositionForScreenPosition([0, 5]).left).toBe 33 - expect(linesYardstick.pixelPositionForScreenPosition([0, 7]).left).toBe 50 - expect(linesYardstick.pixelPositionForScreenPosition([0, 9]).left).toBe 67 - expect(linesYardstick.pixelPositionForScreenPosition([0, 11]).left).toBe 84 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 0)).left).toBe 0 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 1)).left).toBe 8 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 2)).left).toBe 16 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 5)).left).toBe 33 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 7)).left).toBe 50 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 9)).left).toBe 67 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 11)).left).toBe 84 it "doesn't report a width greater than 0 when the character to measure is at the beginning of a text node", -> # This spec documents what seems to be a bug in Chromium, because we'd @@ -137,9 +138,9 @@ describe "LinesYardstick", -> editor.setText(text) - expect(linesYardstick.pixelPositionForScreenPosition([0, 35]).left).toBe 230.90625 - expect(linesYardstick.pixelPositionForScreenPosition([0, 36]).left).toBe 237.5 - expect(linesYardstick.pixelPositionForScreenPosition([0, 37]).left).toBe 244.09375 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 35)).left).toBe 230.90625 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 36)).left).toBe 237.5 + expect(linesYardstick.pixelPositionForScreenPosition(Point(0, 37)).left).toBe 244.09375 describe "::screenPositionForPixelPosition(pixelPosition)", -> it "converts pixel positions to screen positions", -> diff --git a/src/lines-yardstick.coffee b/src/lines-yardstick.coffee index bd8219e81..9edbbe17a 100644 --- a/src/lines-yardstick.coffee +++ b/src/lines-yardstick.coffee @@ -77,10 +77,7 @@ class LinesYardstick else Point(row, column) - pixelPositionForScreenPosition: (screenPosition, clip=true) -> - screenPosition = Point.fromObject(screenPosition) - screenPosition = @model.clipScreenPosition(screenPosition) if clip - + pixelPositionForScreenPosition: (screenPosition) -> targetRow = screenPosition.row targetColumn = screenPosition.column diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 6a84c8dac..03644241b 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -434,12 +434,15 @@ class TextEditorComponent getVisibleRowRange: -> @presenter.getVisibleRowRange() - pixelPositionForScreenPosition: (screenPosition, clip) -> + pixelPositionForScreenPosition: (screenPosition, clip=true) -> + screenPosition = Point.fromObject(screenPosition) + screenPosition = @editor.clipScreenPosition(screenPosition) if clip + unless @presenter.isRowVisible(screenPosition.row) @presenter.setScreenRowsToMeasure([screenPosition.row]) @updateSyncPreMeasurement() - pixelPosition = @linesYardstick.pixelPositionForScreenPosition(screenPosition, clip) + pixelPosition = @linesYardstick.pixelPositionForScreenPosition(screenPosition) @presenter.clearScreenRowsToMeasure() pixelPosition diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 1912f4c2e..6841cf70e 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -433,7 +433,7 @@ class TextEditorPresenter else screenPosition = decoration.getMarker().getHeadScreenPosition() - pixelPosition = @pixelPositionForScreenPosition(screenPosition, true) + pixelPosition = @pixelPositionForScreenPosition(screenPosition) top = pixelPosition.top + @lineHeight left = pixelPosition.left + @gutterWidth @@ -649,8 +649,10 @@ class TextEditorPresenter updateHorizontalDimensions: -> if @baseCharacterWidth? oldContentWidth = @contentWidth - clip = @model.tokenizedLineForScreenRow(@model.getLongestScreenRow())?.isSoftWrapped() - @contentWidth = @pixelPositionForScreenPosition([@model.getLongestScreenRow(), @model.getMaxScreenLineLength()], clip).left + rightmostPosition = Point(@model.getLongestScreenRow(), @model.getMaxScreenLineLength()) + if @model.tokenizedLineForScreenRow(rightmostPosition.row)?.isSoftWrapped() + rightmostPosition = @model.clipScreenPosition(rightmostPosition) + @contentWidth = @pixelPositionForScreenPosition(rightmostPosition).left @contentWidth += @scrollLeft @contentWidth += 1 unless @model.isSoftWrapped() # account for cursor width @@ -966,9 +968,9 @@ class TextEditorPresenter hasPixelPositionRequirements: -> @lineHeight? and @baseCharacterWidth? - pixelPositionForScreenPosition: (screenPosition, clip=true) -> + pixelPositionForScreenPosition: (screenPosition) -> position = - @linesYardstick.pixelPositionForScreenPosition(screenPosition, clip, true) + @linesYardstick.pixelPositionForScreenPosition(screenPosition) position.top -= @getScrollTop() position.left -= @getScrollLeft() @@ -987,14 +989,14 @@ class TextEditorPresenter lineHeight = @model.getLineHeightInPixels() if screenRange.end.row > screenRange.start.row - top = @linesYardstick.pixelPositionForScreenPosition(screenRange.start, true).top + top = @linesYardstick.pixelPositionForScreenPosition(screenRange.start).top left = 0 height = (screenRange.end.row - screenRange.start.row + 1) * lineHeight width = @getScrollWidth() else - {top, left} = @linesYardstick.pixelPositionForScreenPosition(screenRange.start, false) + {top, left} = @linesYardstick.pixelPositionForScreenPosition(screenRange.start) height = lineHeight - width = @linesYardstick.pixelPositionForScreenPosition(screenRange.end, false).left - left + width = @linesYardstick.pixelPositionForScreenPosition(screenRange.end).left - left {top, left, width, height} @@ -1139,8 +1141,8 @@ class TextEditorPresenter buildHighlightRegions: (screenRange) -> lineHeightInPixels = @lineHeight - startPixelPosition = @pixelPositionForScreenPosition(screenRange.start, false) - endPixelPosition = @pixelPositionForScreenPosition(screenRange.end, false) + startPixelPosition = @pixelPositionForScreenPosition(screenRange.start) + endPixelPosition = @pixelPositionForScreenPosition(screenRange.end) spannedRows = screenRange.end.row - screenRange.start.row + 1 regions = [] From 66697036770043d67d834829ecac71f9fa1cfe36 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 4 Jan 2016 16:40:56 -0700 Subject: [PATCH 22/31] =?UTF-8?q?Force=20a=20sync=20render=20when=20measur?= =?UTF-8?q?ing=20if=20we=20don=E2=80=99t=20have=20a=20DOM=20node=20for=20a?= =?UTF-8?q?=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/text-editor-component-spec.js | 7 +++++++ src/text-editor-component.coffee | 2 ++ src/text-editor-presenter.coffee | 3 +++ 3 files changed, 12 insertions(+) diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index d5e9f5425..0546926e3 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -4567,6 +4567,13 @@ describe('TextEditorComponent', function () { }) }) + describe('::pixelPositionForScreenPosition()', () => { + it('returns the correct horizontal position, even if it is on a row that has not yet been rendered (regression)', () => { + editor.setTextInBufferRange([[5, 0], [6, 0]], 'hello world\n') + expect(wrapperNode.pixelPositionForScreenPosition([5, Infinity]).left).toBeGreaterThan(0) + }) + }) + describe('middle mouse paste on Linux', function () { let originalPlatform diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 03644241b..d97d82d04 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -440,6 +440,8 @@ class TextEditorComponent unless @presenter.isRowVisible(screenPosition.row) @presenter.setScreenRowsToMeasure([screenPosition.row]) + + unless @linesComponent.lineNodeForLineIdAndScreenRow(@presenter.lineIdForScreenRow(screenPosition.row), screenPosition.row)? @updateSyncPreMeasurement() pixelPosition = @linesYardstick.pixelPositionForScreenPosition(screenPosition) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 6841cf70e..40ea95514 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -1377,3 +1377,6 @@ class TextEditorPresenter isRowVisible: (row) -> @startRow <= row < @endRow + + lineIdForScreenRow: (screenRow) -> + @model.tokenizedLineForScreenRow(screenRow)?.id From 38e331691bcda4503b14ea1321147b87465027f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Machist=C3=A9=20N=2E=20Quintana?= Date: Mon, 4 Jan 2016 20:42:23 -0500 Subject: [PATCH 23/31] :arrow_up: apm@1.6.0 --- apm/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apm/package.json b/apm/package.json index b8dda21ea..2e6b0b8ea 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.5.0" + "atom-package-manager": "1.6.0" } } From 94b77d099844c84903b338a6465cc54017a9a62c Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 11:59:59 -0500 Subject: [PATCH 24/31] Separate the offset determination from the dimensions. --- src/browser/atom-application.coffee | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index f6934761a..a5a535b93 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -360,15 +360,18 @@ class AtomApplication focusedWindow: -> _.find @windows, (atomWindow) -> atomWindow.isFocused() - # Get the dimensions for opening a new window by cascading as appropriate to - # the platform. - getDimensionsForNewWindow: -> + # Get the platform-specific window offset for new windows. + getWindowOffsetForCurrentPlatform: -> offsetByPlatform = darwin: 22 win32: 26 + offsetByPlatform[process.platform] ? 0 + # Get the dimensions for opening a new window by cascading as appropriate to + # the platform. + getDimensionsForNewWindow: -> dimensions = (@focusedWindow() ? @lastFocusedWindow)?.getDimensions() - offset = offsetByPlatform[process.platform] + offset = @getWindowOffsetForCurrentPlatform() if dimensions? and offset? dimensions.x += offset dimensions.y += offset From 4ddadcc13580046dacc77b9b7af7198bc199e314 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 12:00:08 -0500 Subject: [PATCH 25/31] Integration test for new window offset. --- spec/integration/helpers/start-atom.coffee | 3 +++ spec/integration/startup-spec.coffee | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/spec/integration/helpers/start-atom.coffee b/spec/integration/helpers/start-atom.coffee index b8768f532..8290a554e 100644 --- a/spec/integration/helpers/start-atom.coffee +++ b/spec/integration/helpers/start-atom.coffee @@ -127,6 +127,9 @@ buildAtomClient = (args, env) -> .execute -> require("remote").require("app").emit("before-quit") .call(done) + .addCommand "getWindowPosition", (cb) -> + @execute((-> atom.getPosition()), cb) + module.exports = (args, env, fn) -> [chromedriver, chromedriverLogs, chromedriverExit] = [] diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index 799c7685f..374078111 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -181,6 +181,25 @@ describe "Starting Atom", -> , 5000) .waitForPaneItemCount(1, 5000) + it "opens a new window offset from the other window", -> + runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> + win0Position = null + win1Position = null + client + .waitForWindowCount(1, 10000) + .getWindowPosition() + .then ({value}) -> win0Position = value + .waitForNewWindow(-> + @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) + , 5000) + .waitForWindowCount(2, 10000) + .getWindowPosition() + .then ({value}) -> win1Position = value + .then -> + offset = atom.getWindowOffsetForCurrentPlatform() + expect(win0Position.x).toEqual(win1Position.x + offset) + expect(win0Position.y).toEqual(win1Position.y + offset) + it "doesn't open a new window if openEmptyEditorOnStart is disabled", -> configPath = path.join(atomHome, 'config.cson') config = CSON.readFileSync(configPath) From c8c8bc941e7c0ae73c2e6e5d7c16ed98d0221188 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 12:27:59 -0500 Subject: [PATCH 26/31] Revert "Integration test for new window offset." This reverts commit 4ddadcc13580046dacc77b9b7af7198bc199e314. --- spec/integration/helpers/start-atom.coffee | 3 --- spec/integration/startup-spec.coffee | 19 ------------------- 2 files changed, 22 deletions(-) diff --git a/spec/integration/helpers/start-atom.coffee b/spec/integration/helpers/start-atom.coffee index 8290a554e..b8768f532 100644 --- a/spec/integration/helpers/start-atom.coffee +++ b/spec/integration/helpers/start-atom.coffee @@ -127,9 +127,6 @@ buildAtomClient = (args, env) -> .execute -> require("remote").require("app").emit("before-quit") .call(done) - .addCommand "getWindowPosition", (cb) -> - @execute((-> atom.getPosition()), cb) - module.exports = (args, env, fn) -> [chromedriver, chromedriverLogs, chromedriverExit] = [] diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index 374078111..799c7685f 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -181,25 +181,6 @@ describe "Starting Atom", -> , 5000) .waitForPaneItemCount(1, 5000) - it "opens a new window offset from the other window", -> - runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> - win0Position = null - win1Position = null - client - .waitForWindowCount(1, 10000) - .getWindowPosition() - .then ({value}) -> win0Position = value - .waitForNewWindow(-> - @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) - , 5000) - .waitForWindowCount(2, 10000) - .getWindowPosition() - .then ({value}) -> win1Position = value - .then -> - offset = atom.getWindowOffsetForCurrentPlatform() - expect(win0Position.x).toEqual(win1Position.x + offset) - expect(win0Position.y).toEqual(win1Position.y + offset) - it "doesn't open a new window if openEmptyEditorOnStart is disabled", -> configPath = path.join(atomHome, 'config.cson') config = CSON.readFileSync(configPath) From 2a29e7d1f4fc63519b06c5095c4f5e59fc4fe911 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 12:48:34 -0500 Subject: [PATCH 27/31] Revert "Revert "Integration test for new window offset."" This reverts commit c8c8bc941e7c0ae73c2e6e5d7c16ed98d0221188. --- spec/integration/helpers/start-atom.coffee | 3 +++ spec/integration/startup-spec.coffee | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/spec/integration/helpers/start-atom.coffee b/spec/integration/helpers/start-atom.coffee index b8768f532..8290a554e 100644 --- a/spec/integration/helpers/start-atom.coffee +++ b/spec/integration/helpers/start-atom.coffee @@ -127,6 +127,9 @@ buildAtomClient = (args, env) -> .execute -> require("remote").require("app").emit("before-quit") .call(done) + .addCommand "getWindowPosition", (cb) -> + @execute((-> atom.getPosition()), cb) + module.exports = (args, env, fn) -> [chromedriver, chromedriverLogs, chromedriverExit] = [] diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index 799c7685f..374078111 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -181,6 +181,25 @@ describe "Starting Atom", -> , 5000) .waitForPaneItemCount(1, 5000) + it "opens a new window offset from the other window", -> + runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> + win0Position = null + win1Position = null + client + .waitForWindowCount(1, 10000) + .getWindowPosition() + .then ({value}) -> win0Position = value + .waitForNewWindow(-> + @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) + , 5000) + .waitForWindowCount(2, 10000) + .getWindowPosition() + .then ({value}) -> win1Position = value + .then -> + offset = atom.getWindowOffsetForCurrentPlatform() + expect(win0Position.x).toEqual(win1Position.x + offset) + expect(win0Position.y).toEqual(win1Position.y + offset) + it "doesn't open a new window if openEmptyEditorOnStart is disabled", -> configPath = path.join(atomHome, 'config.cson') config = CSON.readFileSync(configPath) From f64878208f3eb47fff1e80dfe236782e9ca19129 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 14:07:50 -0500 Subject: [PATCH 28/31] Really don't need this to be its own command. --- spec/integration/helpers/start-atom.coffee | 3 --- 1 file changed, 3 deletions(-) diff --git a/spec/integration/helpers/start-atom.coffee b/spec/integration/helpers/start-atom.coffee index 8290a554e..b8768f532 100644 --- a/spec/integration/helpers/start-atom.coffee +++ b/spec/integration/helpers/start-atom.coffee @@ -127,9 +127,6 @@ buildAtomClient = (args, env) -> .execute -> require("remote").require("app").emit("before-quit") .call(done) - .addCommand "getWindowPosition", (cb) -> - @execute((-> atom.getPosition()), cb) - module.exports = (args, env, fn) -> [chromedriver, chromedriverLogs, chromedriverExit] = [] From 740e8c660a714b2d52d5688feb2d59dfd90e66de Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 14:08:09 -0500 Subject: [PATCH 29/31] Put it with its friends. --- spec/integration/startup-spec.coffee | 37 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index 374078111..d66bcb077 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -125,6 +125,24 @@ describe "Starting Atom", -> .treeViewRootDirectories() .then ({value}) -> expect(value).toEqual([otherTempDirPath]) + it "opens the new window offset from the other window", -> + runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> + win0Position = null + win1Position = null + client + .waitForWindowCount(1, 10000) + .execute -> atom.getPosition() + .then ({value}) -> win0Position = value + .waitForNewWindow(-> + @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) + , 5000) + .waitForWindowCount(2, 10000) + .execute -> atom.getPosition() + .then ({value}) -> win1Position = value + .then -> + expect(win0Position.x).toEqual(win1Position.x + 22) + expect(win0Position.y).toEqual(win1Position.y + 22) + describe "reopening a directory that was previously opened", -> it "remembers the state of the window", -> runAtom [tempDirPath], {ATOM_HOME: atomHome}, (client) -> @@ -181,25 +199,6 @@ describe "Starting Atom", -> , 5000) .waitForPaneItemCount(1, 5000) - it "opens a new window offset from the other window", -> - runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) -> - win0Position = null - win1Position = null - client - .waitForWindowCount(1, 10000) - .getWindowPosition() - .then ({value}) -> win0Position = value - .waitForNewWindow(-> - @startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome) - , 5000) - .waitForWindowCount(2, 10000) - .getWindowPosition() - .then ({value}) -> win1Position = value - .then -> - offset = atom.getWindowOffsetForCurrentPlatform() - expect(win0Position.x).toEqual(win1Position.x + offset) - expect(win0Position.y).toEqual(win1Position.y + offset) - it "doesn't open a new window if openEmptyEditorOnStart is disabled", -> configPath = path.join(atomHome, 'config.cson') config = CSON.readFileSync(configPath) From d224efb00d0b01a073fd75f6523731f5b5567225 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 5 Jan 2016 14:40:09 -0500 Subject: [PATCH 30/31] Just test the x coordinate, I suppose. --- spec/integration/startup-spec.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/integration/startup-spec.coffee b/spec/integration/startup-spec.coffee index d66bcb077..da4e08ae2 100644 --- a/spec/integration/startup-spec.coffee +++ b/spec/integration/startup-spec.coffee @@ -140,8 +140,11 @@ describe "Starting Atom", -> .execute -> atom.getPosition() .then ({value}) -> win1Position = value .then -> - expect(win0Position.x).toEqual(win1Position.x + 22) - expect(win0Position.y).toEqual(win1Position.y + 22) + expect(win1Position.x).toBeGreaterThan(win0Position.x) + # Ideally we'd test the y coordinate too, but if the window's + # already as tall as it can be, then OS X won't move it down outside + # the screen. + # expect(win1Position.y).toBeGreaterThan(win0Position.y) describe "reopening a directory that was previously opened", -> it "remembers the state of the window", -> From 972d62f9d2fffd8d32d7ad01bc2a73c4cfab6599 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 5 Jan 2016 17:23:32 -0800 Subject: [PATCH 31/31] :arrow_up: text-buffer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 591e1a2a0..d6eefcc7c 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.1.3", + "text-buffer": "8.1.4", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "yargs": "^3.23.0"