From a8cb423b68ee0b79c8b497cb380f57522fa00dbd Mon Sep 17 00:00:00 2001 From: Jonathan Mast Date: Sat, 26 Mar 2016 10:15:11 -0400 Subject: [PATCH 01/19] :penguin: Use %F instead of %U for file variable The desktop entry specification states that %U is for URLs and %F is for files. Since atom doesn't support URLs, we should use %F. Fixes #2320. --- resources/linux/atom.desktop.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/linux/atom.desktop.in b/resources/linux/atom.desktop.in index 290d368d2..6fa5d79c8 100644 --- a/resources/linux/atom.desktop.in +++ b/resources/linux/atom.desktop.in @@ -2,7 +2,7 @@ Name=<%= appName %> Comment=<%= description %> GenericName=Text Editor -Exec=<%= installDir %>/share/<%= appFileName %>/atom %U +Exec=<%= installDir %>/share/<%= appFileName %>/atom %F Icon=<%= iconPath %> Type=Application StartupNotify=true From 24befe2454fd03bcb5a9375f58ff38cb68addf2e Mon Sep 17 00:00:00 2001 From: Zirro Date: Thu, 4 Aug 2016 23:11:22 +0200 Subject: [PATCH 02/19] Handle double-click on custom title bar --- src/application-delegate.coffee | 11 ++++++++++- src/title-bar.coffee | 12 ++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index 74c498e78..5249eac96 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -1,5 +1,5 @@ _ = require 'underscore-plus' -{screen, ipcRenderer, remote, shell, webFrame} = require 'electron' +{screen, ipcRenderer, remote, shell, systemPreferences, webFrame} = require 'electron' ipcHelpers = require './ipc-helpers' {Disposable} = require 'event-kit' {getWindowLoadSettings, setWindowLoadSettings} = require './window-load-settings-helpers' @@ -57,12 +57,18 @@ class ApplicationDelegate reloadWindow: -> ipcRenderer.send("call-window-method", "reload") + minimizeWindow: -> + ipcRenderer.send("call-window-method", "minimize") + isWindowMaximized: -> remote.getCurrentWindow().isMaximized() maximizeWindow: -> ipcRenderer.send("call-window-method", "maximize") + unmaximizeWindow: -> + ipcRenderer.send("call-window-method", "unmaximize") + isWindowFullScreen: -> remote.getCurrentWindow().isFullScreen() @@ -130,6 +136,9 @@ class ApplicationDelegate getPrimaryDisplayWorkAreaSize: -> remote.screen.getPrimaryDisplay().workAreaSize + getAppleActionOnDoubleClick: -> + remote.systemPreferences.getUserDefault("AppleActionOnDoubleClick", "string") + confirm: ({message, detailedMessage, buttons}) -> buttons ?= {} if _.isArray(buttons) diff --git a/src/title-bar.coffee b/src/title-bar.coffee index e2da3ed62..ec4bafe15 100644 --- a/src/title-bar.coffee +++ b/src/title-bar.coffee @@ -8,12 +8,24 @@ class TitleBar @titleElement.classList.add('title') @element.appendChild(@titleElement) + @element.addEventListener 'dblclick', @dblclickHandler + @workspace.onDidChangeActivePaneItem => @updateTitle() @themes.onDidChangeActiveThemes => @updateWindowSheetOffset() @updateTitle() @updateWindowSheetOffset() + dblclickHandler: => + switch @applicationDelegate.getAppleActionOnDoubleClick() + when 'Minimize' + @applicationDelegate.minimizeWindow() + when 'Maximize' + if @applicationDelegate.isWindowMaximized() + @applicationDelegate.unmaximizeWindow() + else + @applicationDelegate.maximizeWindow() + updateTitle: -> @titleElement.textContent = document.title From 1ce2f6ce870f363892dc802a52098ae6115b7352 Mon Sep 17 00:00:00 2001 From: Yuya Tanaka Date: Mon, 11 Apr 2016 02:18:30 +0900 Subject: [PATCH 03/19] :bug: Fix window size is not updated on resize --- spec/text-editor-component-spec.js | 11 +++++++++++ src/text-editor-component.coffee | 1 + 2 files changed, 12 insertions(+) diff --git a/spec/text-editor-component-spec.js b/spec/text-editor-component-spec.js index 83f5d1b80..756358874 100644 --- a/spec/text-editor-component-spec.js +++ b/spec/text-editor-component-spec.js @@ -2251,6 +2251,17 @@ describe('TextEditorComponent', function () { expect(overlay.style.left).toBe(windowWidth - itemWidth + 'px') expect(overlay.style.top).toBe(position.top + editor.getLineHeightInPixels() + 'px') + + // window size change + + windowWidth = Math.round(gutterWidth + 29 * editor.getDefaultCharWidth()) + await atom.setWindowDimensions({ + width: windowWidth, + height: windowHeight, + }) + atom.views.performDocumentPoll() + expect(overlay.style.left).toBe(windowWidth - itemWidth + 'px') + expect(overlay.style.top).toBe(position.top + editor.getLineHeightInPixels() + 'px') }) }) }) diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 3949f18e5..5f03f6c34 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -757,6 +757,7 @@ class TextEditorComponent pollDOM: => unless @checkForVisibilityChange() @sampleBackgroundColors() + @measureWindowSize() @measureDimensions() @sampleFontStyling() @overlayManager?.measureOverlays() From d5aa5f38009886ad6ab69f69d7c133e8ebcf5968 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 5 Aug 2016 12:38:20 -0600 Subject: [PATCH 04/19] :arrow_up: exception-reporting --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a17c23886..f704b9843 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "deprecation-cop": "0.54.1", "dev-live-reload": "0.47.0", "encoding-selector": "0.22.0", - "exception-reporting": "0.38.2", + "exception-reporting": "0.38.3", "find-and-replace": "0.201.0", "fuzzy-finder": "1.3.0", "git-diff": "1.1.0", From 5662b578665c40c9e13bce7f510105f1616ae3c4 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 5 Aug 2016 12:59:57 -0600 Subject: [PATCH 05/19] =?UTF-8?q?Don=E2=80=99t=20delete=20package=20metada?= =?UTF-8?q?ta=20during=20slug=20compilation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This saves space, but leads to surprises when package code tries to read these files for purposes of introspection. For example, it was causing us not to report exceptions from the exception-reporting package. The .1% of the app bundle size it saves doesn’t seem worth the potential for problems. Signed-off-by: Max Brunsfeld --- build/tasks/compile-packages-slug-task.coffee | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/build/tasks/compile-packages-slug-task.coffee b/build/tasks/compile-packages-slug-task.coffee index f6f297bec..a4f9ff072 100644 --- a/build/tasks/compile-packages-slug-task.coffee +++ b/build/tasks/compile-packages-slug-task.coffee @@ -8,13 +8,12 @@ semver = require 'semver' OtherPlatforms = ['darwin', 'freebsd', 'linux', 'sunos', 'win32'].filter (platform) -> platform isnt process.platform module.exports = (grunt) -> - {spawn, rm} = require('./task-helpers')(grunt) + {spawn} = require('./task-helpers')(grunt) getMenu = (appDir) -> menusPath = path.join(appDir, 'menus') menuPath = path.join(menusPath, "#{process.platform}.json") menu = CSON.readFileSync(menuPath) if fs.isFileSync(menuPath) - rm menusPath menu getKeymaps = (appDir) -> @@ -26,7 +25,6 @@ module.exports = (grunt) -> keymap = CSON.readFileSync(keymapPath) keymaps[path.basename(keymapPath)] = keymap - rm keymapsPath keymaps grunt.registerTask 'compile-packages-slug', 'Add bundled package metadata information to the main package.json file', -> @@ -54,7 +52,6 @@ module.exports = (grunt) -> moduleCache = metadata._atomModuleCache ? {} - rm metadataPath _.remove(moduleCache.extensions?['.json'] ? [], 'package.json') for property in ['_from', '_id', 'dist', 'readme', 'readmeFilename'] @@ -70,15 +67,11 @@ module.exports = (grunt) -> for keymapPath in fs.listSync(keymapsPath, ['.cson', '.json']) relativePath = path.relative(appDir, keymapPath) pack.keymaps[relativePath] = CSON.readFileSync(keymapPath) - rm keymapPath - rm keymapsPath if fs.listSync(keymapsPath).length is 0 menusPath = path.join(moduleDirectory, 'menus') for menuPath in fs.listSync(menusPath, ['.cson', '.json']) relativePath = path.relative(appDir, menuPath) pack.menus[relativePath] = CSON.readFileSync(menuPath) - rm menuPath - rm menusPath if fs.listSync(menusPath).length is 0 packages[metadata.name] = pack From b3829200d068a61bd8be4d626be24a86a030554b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 5 Aug 2016 13:05:10 -0600 Subject: [PATCH 06/19] :arrow_up: exception-reporting Signed-off-by: Max Brunsfeld --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f704b9843..a409f6a9b 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "deprecation-cop": "0.54.1", "dev-live-reload": "0.47.0", "encoding-selector": "0.22.0", - "exception-reporting": "0.38.3", + "exception-reporting": "0.38.4", "find-and-replace": "0.201.0", "fuzzy-finder": "1.3.0", "git-diff": "1.1.0", From 04b8bd03aeee637198f72fa2ef98b5b03788b798 Mon Sep 17 00:00:00 2001 From: Zirro Date: Fri, 5 Aug 2016 21:40:34 +0200 Subject: [PATCH 07/19] Introduce a non-explicit getUserDefault-method --- src/application-delegate.coffee | 4 ++-- src/title-bar.coffee | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index 5249eac96..3372962be 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -136,8 +136,8 @@ class ApplicationDelegate getPrimaryDisplayWorkAreaSize: -> remote.screen.getPrimaryDisplay().workAreaSize - getAppleActionOnDoubleClick: -> - remote.systemPreferences.getUserDefault("AppleActionOnDoubleClick", "string") + getUserDefault: (key, type) -> + remote.systemPreferences.getUserDefault(key, type) confirm: ({message, detailedMessage, buttons}) -> buttons ?= {} diff --git a/src/title-bar.coffee b/src/title-bar.coffee index ec4bafe15..b81b08060 100644 --- a/src/title-bar.coffee +++ b/src/title-bar.coffee @@ -17,7 +17,8 @@ class TitleBar @updateWindowSheetOffset() dblclickHandler: => - switch @applicationDelegate.getAppleActionOnDoubleClick() + # User preference deciding which action to take on a title bar double-click + switch @applicationDelegate.getUserDefault('AppleActionOnDoubleClick', 'string') when 'Minimize' @applicationDelegate.minimizeWindow() when 'Maximize' From 6c6cb66e5b1a12d94804b1d893f1b2aff232dd09 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 6 Aug 2016 06:34:38 -0600 Subject: [PATCH 08/19] Rename git-spec to git-repository-spec to match class name --- spec/{git-spec.coffee => git-repository-spec.coffee} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spec/{git-spec.coffee => git-repository-spec.coffee} (100%) diff --git a/spec/git-spec.coffee b/spec/git-repository-spec.coffee similarity index 100% rename from spec/git-spec.coffee rename to spec/git-repository-spec.coffee From cd8e4eb43e110e494b2fc240e236d0ccb7e606c2 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 6 Aug 2016 06:44:59 -0600 Subject: [PATCH 09/19] Avoid passing paths outside of repository to status subprocess --- spec/git-repository-spec.coffee | 18 +++++++++++++++++- src/git-repository.coffee | 5 +++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/spec/git-repository-spec.coffee b/spec/git-repository-spec.coffee index ef87d83ee..d427fc3b9 100644 --- a/spec/git-repository-spec.coffee +++ b/spec/git-repository-spec.coffee @@ -199,7 +199,7 @@ describe "GitRepository", -> beforeEach -> workingDirectory = copyRepository() - repo = new GitRepository(workingDirectory) + repo = new GitRepository(workingDirectory, {project: atom.project, config: atom.config}) modifiedPath = path.join(workingDirectory, 'file.txt') newPath = path.join(workingDirectory, 'untracked.txt') cleanPath = path.join(workingDirectory, 'other.txt') @@ -249,6 +249,22 @@ describe "GitRepository", -> expect(repo.isStatusModified(status)).toBe false expect(repo.isStatusNew(status)).toBe false + it "works correctly when the project has multiple folders (regression)", -> + atom.project.addPath(workingDirectory) + atom.project.addPath(path.join(__dirname, 'fixtures', 'dir')) + statusHandler = jasmine.createSpy('statusHandler') + repo.onDidChangeStatuses statusHandler + + repo.refreshStatus() + + waitsFor -> + statusHandler.callCount > 0 + + runs -> + expect(repo.getCachedPathStatus(cleanPath)).toBeUndefined() + expect(repo.isStatusNew(repo.getCachedPathStatus(newPath))).toBeTruthy() + expect(repo.isStatusModified(repo.getCachedPathStatus(modifiedPath))).toBeTruthy() + it 'caches statuses that were looked up synchronously', -> originalContent = 'undefined' fs.writeFileSync(modifiedPath, 'making this path modified') diff --git a/src/git-repository.coffee b/src/git-repository.coffee index 85600bba7..c59615378 100644 --- a/src/git-repository.coffee +++ b/src/git-repository.coffee @@ -3,6 +3,7 @@ _ = require 'underscore-plus' {Emitter, Disposable, CompositeDisposable} = require 'event-kit' fs = require 'fs-plus' +path = require 'path' GitUtils = require 'git-utils' Task = require './task' @@ -468,8 +469,8 @@ class GitRepository @handlerPath ?= require.resolve('./repository-status-handler') relativeProjectPaths = @project?.getPaths() - .map (path) => @relativize(path) - .filter (path) -> path.length > 0 + .map (projectPath) => @relativize(projectPath) + .filter (projectPath) -> projectPath.length > 0 and not path.isAbsolute(projectPath) @statusTask?.terminate() new Promise (resolve) => From ca76302b3514c9f59379095c44785c88a550917d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 6 Aug 2016 07:09:43 -0600 Subject: [PATCH 10/19] Fix reassignment of path variable. Grrrrr CoffeeScript. --- src/git-repository.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git-repository.coffee b/src/git-repository.coffee index c59615378..7d8dac7c3 100644 --- a/src/git-repository.coffee +++ b/src/git-repository.coffee @@ -433,8 +433,8 @@ class GitRepository # Subscribes to buffer events. subscribeToBuffer: (buffer) -> getBufferPathStatus = => - if path = buffer.getPath() - @getPathStatus(path) + if bufferPath = buffer.getPath() + @getPathStatus(bufferPath) bufferSubscriptions = new CompositeDisposable bufferSubscriptions.add buffer.onDidSave(getBufferPathStatus) From d8a54c9a382094c5448ff40a11989f0bd612be48 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 6 Aug 2016 08:10:17 -0600 Subject: [PATCH 11/19] Fix another path reassignment :grimacing: --- src/git-repository.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/git-repository.coffee b/src/git-repository.coffee index 7d8dac7c3..e0d7dfb25 100644 --- a/src/git-repository.coffee +++ b/src/git-repository.coffee @@ -310,8 +310,8 @@ class GitRepository getDirectoryStatus: (directoryPath) -> directoryPath = "#{@relativize(directoryPath)}/" directoryStatus = 0 - for path, status of @statuses - directoryStatus |= status if path.indexOf(directoryPath) is 0 + for statusPath, status of @statuses + directoryStatus |= status if statusPath.indexOf(directoryPath) is 0 directoryStatus # Public: Get the status of a single path in the repository. From 4a207aff121a517ba563afaa75367bb8fce12b42 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 6 Aug 2016 08:37:20 -0600 Subject: [PATCH 12/19] :arrow_up: status-bar --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f704b9843..9302bdec4 100644 --- a/package.json +++ b/package.json @@ -112,7 +112,7 @@ "settings-view": "0.241.1", "snippets": "1.0.2", "spell-check": "0.67.1", - "status-bar": "1.4.0", + "status-bar": "1.4.1", "styleguide": "0.47.0", "symbols-view": "0.113.0", "tabs": "0.100.0", From 99b19aa05eaaa9f7b17c60eddc132685b389a5d7 Mon Sep 17 00:00:00 2001 From: Zirro Date: Sat, 6 Aug 2016 20:21:26 +0200 Subject: [PATCH 13/19] =?UTF-8?q?=F0=9F=8E=A8=20Remove=20duplicate=20"Note?= =?UTF-8?q?:"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config-schema.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config-schema.coffee b/src/config-schema.coffee index 2a29c4da4..b138a3b7f 100644 --- a/src/config-schema.coffee +++ b/src/config-schema.coffee @@ -271,4 +271,4 @@ if process.platform is 'darwin' module.exports.core.properties.useCustomTitleBar = type: 'boolean' default: false - description: 'Use custom, theme-aware title-bar.
Note: Note: This currently does not include a proxy icon.
This setting will require a relaunch of Atom to take effect.' + description: 'Use custom, theme-aware title bar.
Note: This currently does not include a proxy icon.
This setting will require a relaunch of Atom to take effect.' From ab9a2a92c860007357f412935ff7bbbf2613af38 Mon Sep 17 00:00:00 2001 From: Machiste Quintana Date: Sat, 6 Aug 2016 17:20:46 -0700 Subject: [PATCH 14/19] Rewrite exports/atom.coffee as JS --- exports/atom.coffee | 44 ------------------------------- exports/atom.js | 58 +++++++++++++++++++++++++++++++++++++++++ src/module-cache.coffee | 4 +-- 3 files changed, 60 insertions(+), 46 deletions(-) delete mode 100644 exports/atom.coffee create mode 100644 exports/atom.js diff --git a/exports/atom.coffee b/exports/atom.coffee deleted file mode 100644 index bd8a1b62c..000000000 --- a/exports/atom.coffee +++ /dev/null @@ -1,44 +0,0 @@ -TextBuffer = require 'text-buffer' -{Point, Range} = TextBuffer -{File, Directory} = require 'pathwatcher' -{Emitter, Disposable, CompositeDisposable} = require 'event-kit' -Grim = require 'grim' - -module.exports = - BufferedNodeProcess: require '../src/buffered-node-process' - BufferedProcess: require '../src/buffered-process' - GitRepository: require '../src/git-repository' - Notification: require '../src/notification' - TextBuffer: TextBuffer - Point: Point - Range: Range - File: File - Directory: Directory - Emitter: Emitter - Disposable: Disposable - CompositeDisposable: CompositeDisposable - -# Shell integration is required by both Squirrel and Settings-View -if process.platform is 'win32' - module.exports.WinShell = require '../src/main-process/win-shell' - -# The following classes can't be used from a Task handler and should therefore -# only be exported when not running as a child node process -unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE - module.exports.Task = require '../src/task' - - TextEditor = (params) -> - atom.workspace.buildTextEditor(params) - - TextEditor.prototype = require('../src/text-editor').prototype - - Object.defineProperty module.exports, 'TextEditor', - enumerable: true - get: -> - Grim.deprecate """ - 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 `atom.workspace.isTextEditor(object)`. - """ - TextEditor diff --git a/exports/atom.js b/exports/atom.js new file mode 100644 index 000000000..50c8c687f --- /dev/null +++ b/exports/atom.js @@ -0,0 +1,58 @@ +/** @babel */ + +import TextBuffer, {Point, Range} from 'text-buffer' +import {File, Directory} from 'pathwatcher' +import {Emitter, Disposable, CompositeDisposable} from 'event-kit' +import Grim from 'grim' +import dedent from 'dedent' +import BufferedNodeProcess from '../src/buffered-node-process' +import BufferedProcess from '../src/buffered-process' +import GitRepository from '../src/git-repository' +import Notification from '../src/notification' + +const atomExport = { + BufferedNodeProcess, + BufferedProcess, + GitRepository, + Notification, + TextBuffer, + Point, + Range, + File, + Directory, + Emitter, + Disposable, + CompositeDisposable +} + +// Shell integration is required by both Squirrel and Settings-View +if (process.platform === 'win32') { + atomExport.WinShell = require('../src/main-process/win-shell') +} + +// The following classes can't be used from a Task handler and should therefore +// only be exported when not running as a child node process +if (!process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE) { + atomExport.Task = require('../src/task') + + const TextEditor = (params) => { + return atom.workspace.buildTextEditor(params) + } + + TextEditor.prototype = require('../src/text-editor').prototype + + Object.defineProperty(atomExport, 'TextEditor', { + enumerable: true, + get () { + Grim.deprecate(dedent` + 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 \`atom.workspace.isTextEditor(object)\`. + `) + return TextEditor + } + }) +} + +export default atomExport diff --git a/src/module-cache.coffee b/src/module-cache.coffee index 39bdfa244..8c6a7c312 100644 --- a/src/module-cache.coffee +++ b/src/module-cache.coffee @@ -196,8 +196,8 @@ resolveModulePath = (relativePath, parentModule) -> registerBuiltins = (devMode) -> if devMode or not cache.resourcePath.startsWith("#{process.resourcesPath}#{path.sep}") fs = require 'fs-plus' - atomCoffeePath = path.join(cache.resourcePath, 'exports', 'atom.coffee') - cache.builtins.atom = atomCoffeePath if fs.isFileSync(atomCoffeePath) + atomJsPath = path.join(cache.resourcePath, 'exports', 'atom.js') + cache.builtins.atom = atomJsPath if fs.isFileSync(atomJsPath) cache.builtins.atom ?= path.join(cache.resourcePath, 'exports', 'atom.js') electronAsarRoot = path.join(process.resourcesPath, 'electron.asar') From 1bce81d7102d552544fe2575c1a3b1b0ffade309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Machist=C3=A9=20N=2E=20Quintana?= Date: Sat, 6 Aug 2016 17:25:36 -0700 Subject: [PATCH 15/19] Update object spread guideline in JS styleguide [ci skip] Per discussion in https://github.com/atom/atom/pull/12258 --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 837961e6a..c8a79b4e0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -285,8 +285,8 @@ If you want to read about using Atom or developing packages in Atom, the [Atom F All JavaScript must adhere to [JavaScript Standard Style](http://standardjs.com/). -* Prefer `Object.assign()` to the object spread operator (`{...anotherObj}`) -* Inline `export`s with expressions +* Prefer the object spread operator (`{...anotherObj}`) to `Object.assign()` +* Inline `export`s with expressions whenever possible ```js // Use this: export default class ClassName { From 94b4709db1e3afb2b107aa8fb3683a048bffd953 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 8 Aug 2016 18:09:28 +0200 Subject: [PATCH 16/19] Store last buffer change event id on TokenizedBuffer Signed-off-by: Nathan Sobo --- src/tokenized-buffer.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index ea7082a6d..3bbef3c4d 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -242,6 +242,7 @@ class TokenizedBuffer extends Model row + delta handleBufferChange: (e) -> + @lastBufferChangeEventId = e.eventId @changeCount = @buffer.changeCount {oldRange, newRange} = e From 4b6f09cd10da9ebe2de4a4e5ab617f3a87678128 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 8 Aug 2016 18:41:20 +0200 Subject: [PATCH 17/19] Assert that all buffer events are processed sequentially Signed-off-by: Nathan Sobo --- src/tokenized-buffer.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index 3bbef3c4d..a79e37493 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -242,6 +242,16 @@ class TokenizedBuffer extends Model row + delta handleBufferChange: (e) -> + if @lastBufferChangeEventId? + @assert( + @lastBufferChangeEventId is e.eventId - 1, + 'Buffer Change Event Ids are not sequential', + (error) => + error.metadata = { + tokenizedBufferEventId: @lastBufferChangeEventId, + nextTokenizedBufferEventId: e.eventId, + } + ) @lastBufferChangeEventId = e.eventId @changeCount = @buffer.changeCount From 45890aaa9b80b91a14092c7aec4378025c1ce5c3 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 8 Aug 2016 11:45:25 -0600 Subject: [PATCH 18/19] :arrow_up: exception-reporting --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9302bdec4..9a9b0a010 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "deprecation-cop": "0.54.1", "dev-live-reload": "0.47.0", "encoding-selector": "0.22.0", - "exception-reporting": "0.38.3", + "exception-reporting": "0.39.0", "find-and-replace": "0.201.0", "fuzzy-finder": "1.3.0", "git-diff": "1.1.0", From ebea9da3008df9ca8ad246b8dc8ef5539ae0c7d8 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 8 Aug 2016 12:10:42 -0600 Subject: [PATCH 19/19] :arrow_up: text-buffer --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9302bdec4..ae6edb4a2 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "sinon": "1.17.4", "source-map-support": "^0.3.2", "temp": "0.8.1", - "text-buffer": "9.2.6", + "text-buffer": "9.2.7", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "winreg": "^1.2.1",