From 1cf5822d20ffef09d2b446e79b75ef59c64b6c6e Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 3 Apr 2015 18:06:28 +0200 Subject: [PATCH 01/70] Merge intersecting selections by row before deleting lines --- spec/text-editor-spec.coffee | 15 +++++++++++++++ src/selection.coffee | 7 +++++++ src/text-editor.coffee | 17 +++++++++++++---- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index 51226a22b..f2945977a 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -3376,6 +3376,21 @@ describe "TextEditor", -> expect(buffer.lineForRow(0)).toBe(line2) expect(buffer.getLineCount()).toBe(count - 2) + it "deletes only the first line when it has multiple selections", -> + line1 = buffer.lineForRow(1) + count = buffer.getLineCount() + editor.getLastCursor().moveToTop() + editor.setSelectedBufferRanges([ + [[0, 1], [0, 2]], + [[0, 4], [0, 5]] + ]) + expect(buffer.lineForRow(0)).not.toBe(line1) + + editor.deleteLine() + + expect(buffer.lineForRow(0)).toBe(line1) + expect(buffer.getLineCount()).toBe(count - 1) + it "only deletes first line if only newline is selected on second line", -> editor.setSelectedBufferRange([[0, 2], [1, 0]]) line1 = buffer.lineForRow(1) diff --git a/src/selection.coffee b/src/selection.coffee index ea4b54034..971ddbdd9 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -174,6 +174,13 @@ class Selection extends Model intersectsScreenRow: (screenRow) -> @getScreenRange().intersectsRow(screenRow) + intersectsByRowWith: (otherSelection) -> + otherScreenRange = otherSelection.getScreenRange() + + @getScreenRange().intersectsRowRange( + otherScreenRange.start.row, otherScreenRange.end.row + ) + # Public: Identifies if a selection intersects with another selection. # # * `otherSelection` A {Selection} to check against. diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 548725cf6..23a612ee4 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -1114,6 +1114,7 @@ class TextEditor extends Model # Extended: Delete all lines intersecting selections. deleteLine: -> + @mergeIntersectingSelectionsByRow() @mutateSelectedText (selection) -> selection.deleteLine() # Deprecated: Use {::deleteToBeginningOfWord} instead. @@ -2232,6 +2233,17 @@ class TextEditor extends Model # the function with merging suppressed, then merges intersecting selections # afterward. mergeIntersectingSelections: (args...) -> + @mergeSelections args..., (previousSelection, currentSelection) -> + exclusive = not currentSelection.isEmpty() and not previousSelection.isEmpty() + + previousSelection.intersectsWith(currentSelection, exclusive) + + mergeIntersectingSelectionsByRow: (args...) -> + @mergeSelections args..., (previousSelection, currentSelection) -> + previousSelection.intersectsByRowWith(currentSelection) + + mergeSelections: (args...) -> + mergePredicate = args.pop() fn = args.pop() if _.isFunction(_.last(args)) options = args.pop() ? {} @@ -2244,10 +2256,7 @@ class TextEditor extends Model reducer = (disjointSelections, selection) -> adjacentSelection = _.last(disjointSelections) - exclusive = not selection.isEmpty() and not adjacentSelection.isEmpty() - intersects = adjacentSelection.intersectsWith(selection, exclusive) - - if intersects + if mergePredicate(adjacentSelection, selection) adjacentSelection.merge(selection, options) disjointSelections else From 42521900e8248ab95bd8a986e91934d01ecae822 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Fri, 3 Apr 2015 18:10:43 +0200 Subject: [PATCH 02/70] :memo: Improve naming --- spec/text-editor-spec.coffee | 2 +- src/selection.coffee | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index f2945977a..3be0c8b0e 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -3376,7 +3376,7 @@ describe "TextEditor", -> expect(buffer.lineForRow(0)).toBe(line2) expect(buffer.getLineCount()).toBe(count - 2) - it "deletes only the first line when it has multiple selections", -> + it "deletes a line only once when multiple selections are on the same line", -> line1 = buffer.lineForRow(1) count = buffer.getLineCount() editor.getLastCursor().moveToTop() diff --git a/src/selection.coffee b/src/selection.coffee index 971ddbdd9..c6d6933c0 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -174,6 +174,11 @@ class Selection extends Model intersectsScreenRow: (screenRow) -> @getScreenRange().intersectsRow(screenRow) + # Public: Identifies if this selection's rows intersects with another selection's rows. + # + # * `otherSelection` A {Selection} to check against. + # + # Returns a {Boolean} intersectsByRowWith: (otherSelection) -> otherScreenRange = otherSelection.getScreenRange() From 4ec5f2b4adc2dac91b942c15b008e0ac8dd4e0ea Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 09:15:08 -0700 Subject: [PATCH 03/70] :arrow_up: language-c@0.44 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 531f8f093..7fe621085 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "welcome": "0.26.0", "whitespace": "0.29.0", "wrap-guide": "0.32.0", - "language-c": "0.43.0", + "language-c": "0.44.0", "language-clojure": "0.13.0", "language-coffee-script": "0.39.0", "language-csharp": "0.5.0", From a470ab9dd39d1552204d4fb3f478ea800d67ec74 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 09:20:11 -0700 Subject: [PATCH 04/70] :arrow_up: language-javascript@0.68 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7fe621085..2567e164d 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "language-html": "0.31.0", "language-hyperlink": "0.12.2", "language-java": "0.14.0", - "language-javascript": "0.67.0", + "language-javascript": "0.68.0", "language-json": "0.14.0", "language-less": "0.25.0", "language-make": "0.14.0", From e0f316e53c38a6bfc70bce5d98dd4482e81f3122 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 09:26:08 -0700 Subject: [PATCH 05/70] :arrow_up: language-clojure@0.14 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2567e164d..5024e41b2 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "whitespace": "0.29.0", "wrap-guide": "0.32.0", "language-c": "0.44.0", - "language-clojure": "0.13.0", + "language-clojure": "0.14.0", "language-coffee-script": "0.39.0", "language-csharp": "0.5.0", "language-css": "0.28.0", From 4b46a5218e2270965e6cd06160ba68d2e7c82d20 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 09:33:21 -0700 Subject: [PATCH 06/70] :arrow_up: language-ruby@0.51 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5024e41b2..8ca00c56c 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "language-php": "0.22.0", "language-property-list": "0.8.0", "language-python": "0.33.0", - "language-ruby": "0.50.0", + "language-ruby": "0.51.0", "language-ruby-on-rails": "0.21.0", "language-sass": "0.36.0", "language-shellscript": "0.13.0", From af80bc54197e616aab2170eee008bf5fb5ed6abe Mon Sep 17 00:00:00 2001 From: Lee Dohm Date: Thu, 2 Apr 2015 13:32:39 -0700 Subject: [PATCH 07/70] :memo: Make TextEditor::getBuffer public --- 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 cbf1136a2..8d54fadb1 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -459,7 +459,7 @@ class TextEditor extends Model onDidChangeIcon: (callback) -> @emitter.on 'did-change-icon', callback - # Retrieves the current {TextBuffer}. + # Public: Retrieves the current {TextBuffer}. getBuffer: -> @buffer # Retrieves the current buffer's URI. From cf0a18e0f1b9b5e12ecfce47a60c3d61c3dd80b1 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 09:45:31 -0700 Subject: [PATCH 08/70] :arrow_up: markdown-preview@0.148 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8ca00c56c..f280f18bc 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "incompatible-packages": "0.24.0", "keybinding-resolver": "0.30.0", "link": "0.30.0", - "markdown-preview": "0.147.0", + "markdown-preview": "0.148.0", "metrics": "0.45.0", "notifications": "0.35.0", "open-on-github": "0.36.0", From 361732ce8119a189a67cca24f8922f85a1a384c2 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 09:50:59 -0700 Subject: [PATCH 09/70] :arrow_up: snippets@0.88 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f280f18bc..55762cec0 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,7 @@ "package-generator": "0.38.0", "release-notes": "0.52.0", "settings-view": "0.187.0", - "snippets": "0.87.0", + "snippets": "0.88.0", "spell-check": "0.55.0", "status-bar": "0.66.0", "styleguide": "0.44.0", From 39a1d6b788de9537566dd779f71c465b05c36d6d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 10:59:06 -0700 Subject: [PATCH 10/70] Wrap getUri in deprecated API check --- src/pane.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pane.coffee b/src/pane.coffee index c69c74180..b24d5b7e2 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -41,9 +41,9 @@ class Pane extends Model # Called by the Serializable mixin during serialization. serializeParams: -> - if Grim.includeDeprecatedAPIs and typeof @activeItem?.getURI is 'function' + if typeof @activeItem?.getURI is 'function' activeItemURI = @activeItem.getURI() - else if typeof @activeItem?.getUri is 'function' + else if Grim.includeDeprecatedAPIs and typeof @activeItem?.getUri is 'function' activeItemURI = @activeItem.getUri() id: @id From b98c2a8fbb0a100946afae4fd323ae7da895f1f5 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 11:02:14 -0700 Subject: [PATCH 11/70] Only call Directory::off when including deprecated APIs --- src/project.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/project.coffee b/src/project.coffee index b1c939905..5094ef8ce 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -171,7 +171,9 @@ class Project extends Model # # * `projectPaths` {Array} of {String} paths. setPaths: (projectPaths) -> - rootDirectory.off() for rootDirectory in @rootDirectories + if includeDeprecatedAPIs + rootDirectory.off() for rootDirectory in @rootDirectories + repository?.destroy() for repository in @repositories @rootDirectories = [] @repositories = [] @@ -225,7 +227,7 @@ class Project extends Model if indexToRemove? [removedDirectory] = @rootDirectories.splice(indexToRemove, 1) [removedRepository] = @repositories.splice(indexToRemove, 1) - removedDirectory.off() + removedDirectory.off() if includeDeprecatedAPIs removedRepository?.destroy() unless removedRepository in @repositories @emit "path-changed" if includeDeprecatedAPIs @emitter.emit "did-change-paths", @getPaths() From 661b2124b2b1a10ce40ef96694dbbcfd4e2a2b64 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 09:56:40 -0700 Subject: [PATCH 12/70] Use new Model in PaneAxis --- src/pane-axis.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pane-axis.coffee b/src/pane-axis.coffee index a9eb0757b..ec77b17d2 100644 --- a/src/pane-axis.coffee +++ b/src/pane-axis.coffee @@ -1,7 +1,7 @@ -{Model} = require 'theorist' {Emitter, CompositeDisposable} = require 'event-kit' {flatten} = require 'underscore-plus' Serializable = require 'serializable' +Model = require './model' module.exports = class PaneAxis extends Model From 312c03e6d20f6cf8aaeb0bc38c3864a3f2bb29a7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 10:02:02 -0700 Subject: [PATCH 13/70] Conditionally include activePane/activePaneItem properties --- src/pane-container.coffee | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/pane-container.coffee b/src/pane-container.coffee index 61ff9f207..7bc7c37e0 100644 --- a/src/pane-container.coffee +++ b/src/pane-container.coffee @@ -1,7 +1,8 @@ {find, flatten} = require 'underscore-plus' -{Model} = require 'theorist' +Grim = require 'grim' {Emitter, CompositeDisposable} = require 'event-kit' Serializable = require 'serializable' +Model = require './model' Pane = require './pane' PaneElement = require './pane-element' PaneContainerElement = require './pane-container-element' @@ -18,16 +19,8 @@ class PaneContainer extends Model @version: 1 - @properties - activePane: null - root: null - @behavior 'activePaneItem', -> - @$activePane - .switch((activePane) -> activePane?.$activeItem) - .distinctUntilChanged() - constructor: (params) -> super @@ -236,3 +229,15 @@ class PaneContainer extends Model removedPaneItem: (item) -> @itemRegistry.removeItem(item) + +if Grim.includeDeprecatedAPIs + PaneContainer.properties + activePane: null + + PaneContainer.behavior 'activePaneItem', -> + @$activePane + .switch((activePane) -> activePane?.$activeItem) + .distinctUntilChanged() + +else + PaneContainer::activePane = null From 96b95b74e9efae29781276bfd66718d22526c932 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 10:56:33 -0700 Subject: [PATCH 14/70] Conditionally include Pane model properties and behaviors --- src/pane-container.coffee | 4 +++- src/pane.coffee | 38 ++++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/pane-container.coffee b/src/pane-container.coffee index 7bc7c37e0..58da39872 100644 --- a/src/pane-container.coffee +++ b/src/pane-container.coffee @@ -24,6 +24,9 @@ class PaneContainer extends Model constructor: (params) -> super + unless Grim.includeDeprecatedAPIs + @activePane = params?.activePane + @emitter = new Emitter @subscriptions = new CompositeDisposable @@ -238,6 +241,5 @@ if Grim.includeDeprecatedAPIs @$activePane .switch((activePane) -> activePane?.$activeItem) .distinctUntilChanged() - else PaneContainer::activePane = null diff --git a/src/pane.coffee b/src/pane.coffee index b24d5b7e2..dec0789c5 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -15,23 +15,13 @@ class Pane extends Model atom.deserializers.add(this) Serializable.includeInto(this) - @properties - container: undefined - activeItem: undefined - focused: false - - # Public: Only one pane is considered *active* at a time. A pane is activated - # when it is focused, and when focus returns to the pane container after - # moving to another element such as a panel, it returns to the active pane. - @behavior 'active', -> - @$container - .switch((container) -> container?.$activePane) - .map((activePane) => activePane is this) - .distinctUntilChanged() - constructor: (params) -> super + unless Grim.includeDeprecatedAPIs + @container = params?.container + @activeItem = params?.activeItem + @emitter = new Emitter @itemSubscriptions = new WeakMap @items = [] @@ -313,7 +303,8 @@ class Pane extends Model if typeof item.onDidDestroy is 'function' @itemSubscriptions.set item, item.onDidDestroy => @removeItem(item, true) - else if typeof item.on is 'function' + else if Grim.includeDeprecations and typeof item.on is 'function' + deprecate 'If you would like your pane item to support removal when destroyed behavior, please implement a ::onDidDestroy() method. ::on methods for items are no longer supported. If not, ignore this message.' @subscribe item, 'destroyed', => @removeItem(item, true) @items.splice(index, 0, item) @@ -340,7 +331,7 @@ class Pane extends Model index = @items.indexOf(item) return if index is -1 - if typeof item.on is 'function' + if Grim.includeDeprecations and typeof item.on is 'function' @unsubscribe item @unsubscribeFromItem(item) @@ -661,6 +652,17 @@ class Pane extends Model throw error if Grim.includeDeprecatedAPIs + Pane.properties + container: undefined + activeItem: undefined + focused: false + + Pane.behavior 'active', -> + @$container + .switch((container) -> container?.$activePane) + .map((activePane) => activePane is this) + .distinctUntilChanged() + Pane::on = (eventName) -> switch eventName when 'activated' @@ -701,3 +703,7 @@ if Grim.includeDeprecatedAPIs Pane::activateItemForUri = (uri) -> Grim.deprecate("Use `::activateItemForURI` instead.") @activateItemForURI(uri) +else + Pane::container = undefined + Pane::activeItem = undefined + Pane::focused = undefined From 383523677e41fec017c12c40924fd44a71f1f92f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 11:07:17 -0700 Subject: [PATCH 15/70] Use new Model superclass in Pane --- src/pane.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pane.coffee b/src/pane.coffee index dec0789c5..892a42a0c 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -1,8 +1,8 @@ {find, compact, extend, last} = require 'underscore-plus' -{Model} = require 'theorist' {Emitter} = require 'event-kit' Serializable = require 'serializable' Grim = require 'grim' +Model = require './model' PaneAxis = require './pane-axis' TextEditor = require './text-editor' From fcefe55e0d634d0953f4209d6973da2c03b1091b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 11:08:01 -0700 Subject: [PATCH 16/70] Add deprecated check for item.getUri --- src/pane.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pane.coffee b/src/pane.coffee index 892a42a0c..04dbab1f3 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -49,7 +49,7 @@ class Pane extends Model params.activeItem = find params.items, (item) -> if typeof item.getURI is 'function' itemURI = item.getURI() - else if typeof item.getUri is 'function' + else if Grim.includeDeprecatedAPIs and typeof item.getUri is 'function' itemURI = item.getUri() itemURI is activeItemURI From e8e1500d119f00f67d25ce0ce7c1e26e021ab3b5 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 11:22:51 -0700 Subject: [PATCH 17/70] Use new Model superclass in Workspace --- src/workspace.coffee | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index 722a45f21..646ab0a98 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -9,6 +9,7 @@ Serializable = require 'serializable' Grim = require 'grim' fs = require 'fs-plus' StackTraceParser = require 'stacktrace-parser' +Model = require './model' TextEditor = require './text-editor' PaneContainer = require './pane-container' Pane = require './pane' @@ -33,14 +34,14 @@ class Workspace extends Model atom.deserializers.add(this) Serializable.includeInto(this) - @properties - paneContainer: null - fullScreen: false - destroyedItemURIs: -> [] - constructor: (params) -> super + unless Grim.includeDeprecatedAPIs + @paneContainer = params?.paneContainer + @fullScreen = params?.fullScreen ? false + @destroyedItemURIs = params?.destroyedItemURIs ? [] + @emitter = new Emitter @openers = [] @@ -892,6 +893,11 @@ class Workspace extends Model deferred.promise if includeDeprecatedAPIs + Workspace.properties + paneContainer: null + fullScreen: false + destroyedItemURIs: -> [] + Object.defineProperty Workspace::, 'activePaneItem', get: -> Grim.deprecate "Use ::getActivePaneItem() instead of the ::activePaneItem property" From 39a7af1f24764feb2b4723c5e6f3f16ab6d38184 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 11:23:09 -0700 Subject: [PATCH 18/70] Remove theorist require --- src/workspace.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index 646ab0a98..6a7a40a0c 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -2,7 +2,6 @@ _ = require 'underscore-plus' path = require 'path' {join} = path -{Model} = require 'theorist' Q = require 'q' Serializable = require 'serializable' {Emitter, Disposable, CompositeDisposable} = require 'event-kit' From 0691b837a1ff36de858176264dfc56c5da8595bd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 11:25:35 -0700 Subject: [PATCH 19/70] Use new Model superclass in TokenizedBuffer --- src/tokenized-buffer.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index bfc563d93..b9d1d01f6 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -1,8 +1,8 @@ _ = require 'underscore-plus' -{Model} = require 'theorist' {CompositeDisposable, Emitter} = require 'event-kit' {Point, Range} = require 'text-buffer' Serializable = require 'serializable' +Model = require './model' TokenizedLine = require './tokenized-line' Token = require './token' ScopeDescriptor = require './scope-descriptor' @@ -12,11 +12,10 @@ module.exports = class TokenizedBuffer extends Model Serializable.includeInto(this) - @property 'tabLength' - grammar: null currentGrammarScore: null buffer: null + tabLength: null tokenizedLines: null chunkSize: 50 invalidRows: null From 265bc94eb3addee3be4e51c410644e56aef3fa6d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 13:10:37 -0700 Subject: [PATCH 20/70] Bind TextEditor behaviors to deprecated API flag --- src/text-editor.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 8d54fadb1..82781c8ec 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -74,10 +74,6 @@ class TextEditor extends Model 'autoDecreaseIndentForBufferRow', 'toggleLineCommentForBufferRow', 'toggleLineCommentsForBufferRows', toProperty: 'languageMode' - @delegatesProperties '$lineHeightInPixels', '$defaultCharWidth', '$height', '$width', - '$verticalScrollbarWidth', '$horizontalScrollbarHeight', '$scrollTop', '$scrollLeft', - toProperty: 'displayBuffer' - constructor: ({@softTabs, initialLine, initialColumn, tabLength, softWrapped, @displayBuffer, buffer, registerEditor, suppressCursorCreation, @mini, @placeholderText, @gutterVisible}) -> super @@ -108,10 +104,10 @@ class TextEditor extends Model @setEncoding(atom.config.get('core.fileEncoding', scope: @getRootScopeDescriptor())) - @subscribe @$scrollTop, (scrollTop) => + @subscribe @displayBuffer.$scrollTop, (scrollTop) => @emit 'scroll-top-changed', scrollTop if includeDeprecatedAPIs @emitter.emit 'did-change-scroll-top', scrollTop - @subscribe @$scrollLeft, (scrollLeft) => + @subscribe @displayBuffer.$scrollLeft, (scrollLeft) => @emit 'scroll-left-changed', scrollLeft if includeDeprecatedAPIs @emitter.emit 'did-change-scroll-left', scrollLeft @@ -2837,6 +2833,10 @@ class TextEditor extends Model logScreenLines: (start, end) -> @displayBuffer.logLines(start, end) if includeDeprecatedAPIs + TextEditor.delegatesProperties '$lineHeightInPixels', '$defaultCharWidth', '$height', '$width', + '$verticalScrollbarWidth', '$horizontalScrollbarHeight', '$scrollTop', '$scrollLeft', + toProperty: 'displayBuffer' + TextEditor::getViewClass = -> require './text-editor-view' From 72678df7fc91912409e7c7fc33c5c2d647b6f592 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 13:25:55 -0700 Subject: [PATCH 21/70] Use new Model superclass in DisplayBuffer --- src/display-buffer.coffee | 66 +++++++++++++++++++++++++++++---------- src/text-editor.coffee | 7 +++-- 2 files changed, 55 insertions(+), 18 deletions(-) diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index a8b24086a..e5cba3506 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -1,11 +1,11 @@ _ = require 'underscore-plus' Serializable = require 'serializable' -{Model} = require 'theorist' {CompositeDisposable, Emitter} = require 'event-kit' {Point, Range} = require 'text-buffer' TokenizedBuffer = require './tokenized-buffer' RowMap = require './row-map' Fold = require './fold' +Model = require './model' Token = require './token' Decoration = require './decoration' Marker = require './marker' @@ -20,19 +20,6 @@ module.exports = class DisplayBuffer extends Model Serializable.includeInto(this) - @properties - softWrapped: null - editorWidthInChars: null - lineHeightInPixels: null - defaultCharWidth: null - height: null - width: null - scrollTop: 0 - scrollLeft: 0 - scrollWidth: 0 - verticalScrollbarWidth: 15 - horizontalScrollbarHeight: 15 - verticalScrollMargin: 2 horizontalScrollMargin: 6 scopedCharacterWidthsChangeCount: 0 @@ -135,6 +122,20 @@ class DisplayBuffer extends Model onDidChangeCharacterWidths: (callback) -> @emitter.on 'did-change-character-widths', callback + onDidChangeScrollTop: (callback) -> + @emitter.on 'did-change-scroll-top', callback + + onDidChangeScrollLeft: (callback) -> + @emitter.on 'did-change-scroll-left', callback + + observeScrollTop: (callback) -> + callback(@scrollTop) + @onDidChangeScrollTop(callback) + + observeScrollLeft: (callback) -> + callback(@scrollLeft) + @onDidChangeScrollLeft(callback) + observeDecorations: (callback) -> callback(decoration) for decoration in @getDecorations() @onDidAddDecoration(callback) @@ -250,7 +251,11 @@ class DisplayBuffer extends Model getScrollTop: -> @scrollTop setScrollTop: (scrollTop) -> - @scrollTop = Math.round(Math.max(0, Math.min(@getMaxScrollTop(), scrollTop))) + scrollTop = Math.round(Math.max(0, Math.min(@getMaxScrollTop(), scrollTop))) + return if scrollTop is @scrollTop + + @scrollTop = scrollTop + @emitter.emit 'did-change-scroll-top', @scrollTop getMaxScrollTop: -> @getScrollHeight() - @getClientHeight() @@ -262,7 +267,11 @@ class DisplayBuffer extends Model getScrollLeft: -> @scrollLeft setScrollLeft: (scrollLeft) -> - @scrollLeft = Math.round(Math.max(0, Math.min(@getScrollWidth() - @getClientWidth(), scrollLeft))) + scrollLeft = Math.round(Math.max(0, Math.min(@getScrollWidth() - @getClientWidth(), scrollLeft))) + return if scrollLeft is @scrollLeft + + @scrollLeft = scrollLeft + @emitter.emit 'did-change-scroll-left', @scrollLeft getMaxScrollLeft: -> @getScrollWidth() - @getClientWidth() @@ -1228,6 +1237,19 @@ class DisplayBuffer extends Model @foldsByMarkerId[marker.id] if Grim.includeDeprecatedAPIs + DisplayBuffer.properties + softWrapped: null + editorWidthInChars: null + lineHeightInPixels: null + defaultCharWidth: null + height: null + width: null + scrollTop: 0 + scrollLeft: 0 + scrollWidth: 0 + verticalScrollbarWidth: 15 + horizontalScrollbarHeight: 15 + EmitterMixin = require('emissary').Emitter DisplayBuffer::on = (eventName) -> @@ -1256,3 +1278,15 @@ if Grim.includeDeprecatedAPIs Grim.deprecate("DisplayBuffer::on is deprecated. Use event subscription methods instead.") EmitterMixin::on.apply(this, arguments) +else + DisplayBuffer::softWrapped = null + DisplayBuffer::editorWidthInChars = null + DisplayBuffer::lineHeightInPixels = null + DisplayBuffer::defaultCharWidth = null + DisplayBuffer::height = null + DisplayBuffer::width = null + DisplayBuffer::scrollTop = 0 + DisplayBuffer::scrollLeft = 0 + DisplayBuffer::scrollWidth = 0 + DisplayBuffer::verticalScrollbarWidth = 15 + DisplayBuffer::horizontalScrollbarHeight = 15 diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 82781c8ec..a9bf86b33 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -78,6 +78,7 @@ class TextEditor extends Model super @emitter = new Emitter + @disposables = new CompositeDisposable @cursors = [] @selections = [] @@ -104,10 +105,11 @@ class TextEditor extends Model @setEncoding(atom.config.get('core.fileEncoding', scope: @getRootScopeDescriptor())) - @subscribe @displayBuffer.$scrollTop, (scrollTop) => + @disposables.add @displayBuffer.onDidChangeScrollTop (scrollTop) => @emit 'scroll-top-changed', scrollTop if includeDeprecatedAPIs @emitter.emit 'did-change-scroll-top', scrollTop - @subscribe @displayBuffer.$scrollLeft, (scrollLeft) => + + @disposables.add @displayBuffer.onDidChangeScrollLeft (scrollLeft) => @emit 'scroll-left-changed', scrollLeft if includeDeprecatedAPIs @emitter.emit 'did-change-scroll-left', scrollLeft @@ -173,6 +175,7 @@ class TextEditor extends Model destroyed: -> @unsubscribe() + @disposables.dispose() @scopedConfigSubscriptions.dispose() selection.destroy() for selection in @getSelections() @buffer.release() From f36f8ba5eb2992a748bec6f9d7c0c8b65c9d0e8f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 13:32:22 -0700 Subject: [PATCH 22/70] Use new Model superclass in TextEditor --- src/text-editor.coffee | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index a9bf86b33..2ca7d74bb 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -3,13 +3,13 @@ path = require 'path' Serializable = require 'serializable' Delegator = require 'delegato' {includeDeprecatedAPIs, deprecate} = require 'grim' -{Model} = require 'theorist' EmitterMixin = require('emissary').Emitter {CompositeDisposable, Emitter} = require 'event-kit' {Point, Range} = TextBuffer = require 'text-buffer' LanguageMode = require './language-mode' DisplayBuffer = require './display-buffer' Cursor = require './cursor' +Model = require './model' Selection = require './selection' TextMateScopeSelector = require('first-mate').ScopeSelector {Directory} = require "pathwatcher" @@ -129,16 +129,16 @@ class TextEditor extends Model subscribeToBuffer: -> @buffer.retain() - @subscribe @buffer.onDidChangePath => + @disposables.add @buffer.onDidChangePath => unless atom.project.getPaths().length > 0 atom.project.setPaths([path.dirname(@getPath())]) @emit "title-changed" if includeDeprecatedAPIs @emitter.emit 'did-change-title', @getTitle() @emit "path-changed" if includeDeprecatedAPIs @emitter.emit 'did-change-path', @getPath() - @subscribe @buffer.onDidChangeEncoding => + @disposables.add @buffer.onDidChangeEncoding => @emitter.emit 'did-change-encoding', @getEncoding() - @subscribe @buffer.onDidDestroy => @destroy() + @disposables.add @buffer.onDidDestroy => @destroy() # TODO: remove these when we remove the deprecations. They are old events. if includeDeprecatedAPIs @@ -149,18 +149,19 @@ class TextEditor extends Model @preserveCursorPositionOnBufferReload() subscribeToDisplayBuffer: -> - @subscribe @displayBuffer.onDidCreateMarker @handleMarkerCreated - @subscribe @displayBuffer.onDidUpdateMarkers => @mergeIntersectingSelections() - @subscribe @displayBuffer.onDidChangeGrammar => @handleGrammarChange() - @subscribe @displayBuffer.onDidTokenize => @handleTokenization() - @subscribe @displayBuffer.onDidChange (e) => - @emit 'screen-lines-changed', e + @disposables.add @displayBuffer.onDidCreateMarker @handleMarkerCreated + @disposables.add @displayBuffer.onDidUpdateMarkers => @mergeIntersectingSelections() + @disposables.add @displayBuffer.onDidChangeGrammar => @handleGrammarChange() + @disposables.add @displayBuffer.onDidTokenize => @handleTokenization() + @disposables.add @displayBuffer.onDidChange (e) => + @emit 'screen-lines-changed', e if includeDeprecatedAPIs @emitter.emit 'did-change', e # TODO: remove these when we remove the deprecations. Though, no one is likely using them - @subscribe @displayBuffer.onDidChangeSoftWrapped (softWrapped) => @emit 'soft-wrap-changed', softWrapped - @subscribe @displayBuffer.onDidAddDecoration (decoration) => @emit 'decoration-added', decoration - @subscribe @displayBuffer.onDidRemoveDecoration (decoration) => @emit 'decoration-removed', decoration + if includeDeprecatedAPIs + @subscribe @displayBuffer.onDidChangeSoftWrapped (softWrapped) => @emit 'soft-wrap-changed', softWrapped + @subscribe @displayBuffer.onDidAddDecoration (decoration) => @emit 'decoration-added', decoration + @subscribe @displayBuffer.onDidRemoveDecoration (decoration) => @emit 'decoration-removed', decoration @subscribeToScopedConfigSettings() @@ -174,7 +175,7 @@ class TextEditor extends Model subscriptions.add atom.config.onDidChange 'editor.invisibles', scope: scopeDescriptor, => @updateInvisibles() destroyed: -> - @unsubscribe() + @unsubscribe() if includeDeprecatedAPIs @disposables.dispose() @scopedConfigSubscriptions.dispose() selection.destroy() for selection in @getSelections() @@ -719,7 +720,7 @@ class TextEditor extends Model willInsert = true cancel = -> willInsert = false willInsertEvent = {cancel, text} - @emit('will-insert-text', willInsertEvent) + @emit('will-insert-text', willInsertEvent) if includeDeprecatedAPIs @emitter.emit 'will-insert-text', willInsertEvent if willInsert @@ -728,7 +729,7 @@ class TextEditor extends Model @mutateSelectedText (selection) => range = selection.insertText(text, options) didInsertEvent = {text, range} - @emit('did-insert-text', didInsertEvent) + @emit('did-insert-text', didInsertEvent) if includeDeprecatedAPIs @emitter.emit 'did-insert-text', didInsertEvent range else @@ -1661,9 +1662,9 @@ class TextEditor extends Model preserveCursorPositionOnBufferReload: -> cursorPosition = null - @subscribe @buffer.onWillReload => + @disposables.add @buffer.onWillReload => cursorPosition = @getCursorBufferPosition() - @subscribe @buffer.onDidReload => + @disposables.add @buffer.onDidReload => @setCursorBufferPosition(cursorPosition) if cursorPosition cursorPosition = null From 6e3bdd2daf54b9aab1e23cc7d194289e0ff513c1 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 13:38:34 -0700 Subject: [PATCH 23/70] Return value from scroll top/left setters --- src/display-buffer.coffee | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index e5cba3506..ec95d0619 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -252,10 +252,10 @@ class DisplayBuffer extends Model getScrollTop: -> @scrollTop setScrollTop: (scrollTop) -> scrollTop = Math.round(Math.max(0, Math.min(@getMaxScrollTop(), scrollTop))) - return if scrollTop is @scrollTop - - @scrollTop = scrollTop - @emitter.emit 'did-change-scroll-top', @scrollTop + unless scrollTop is @scrollTop + @scrollTop = scrollTop + @emitter.emit 'did-change-scroll-top', @scrollTop + @scrollTop getMaxScrollTop: -> @getScrollHeight() - @getClientHeight() @@ -268,10 +268,10 @@ class DisplayBuffer extends Model getScrollLeft: -> @scrollLeft setScrollLeft: (scrollLeft) -> scrollLeft = Math.round(Math.max(0, Math.min(@getScrollWidth() - @getClientWidth(), scrollLeft))) - return if scrollLeft is @scrollLeft - - @scrollLeft = scrollLeft - @emitter.emit 'did-change-scroll-left', @scrollLeft + unless scrollLeft is @scrollLeft + @scrollLeft = scrollLeft + @emitter.emit 'did-change-scroll-left', @scrollLeft + @scrollLeft getMaxScrollLeft: -> @getScrollWidth() - @getClientWidth() From b45aa8c51f7763309d3375767e05d973924f5cbc Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 13:44:17 -0700 Subject: [PATCH 24/70] includeDeprecations -> includeDeprecatedAPIs --- src/pane.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pane.coffee b/src/pane.coffee index 04dbab1f3..75daa782c 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -303,8 +303,8 @@ class Pane extends Model if typeof item.onDidDestroy is 'function' @itemSubscriptions.set item, item.onDidDestroy => @removeItem(item, true) - else if Grim.includeDeprecations and typeof item.on is 'function' - deprecate 'If you would like your pane item to support removal when destroyed behavior, please implement a ::onDidDestroy() method. ::on methods for items are no longer supported. If not, ignore this message.' + else if Grim.includeDeprecatedAPIs and typeof item.on is 'function' + Grim.deprecate 'If you would like your pane item to support removal when destroyed behavior, please implement a ::onDidDestroy() method. ::on methods for items are no longer supported. If not, ignore this message.' @subscribe item, 'destroyed', => @removeItem(item, true) @items.splice(index, 0, item) @@ -331,7 +331,7 @@ class Pane extends Model index = @items.indexOf(item) return if index is -1 - if Grim.includeDeprecations and typeof item.on is 'function' + if Grim.includeDeprecatedAPIs and typeof item.on is 'function' @unsubscribe item @unsubscribeFromItem(item) From c4062d8fea0e34341e22acd9b27e4a7d505ecab2 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 13:57:52 -0700 Subject: [PATCH 25/70] Remove destroyed event deprecation --- src/pane.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pane.coffee b/src/pane.coffee index 75daa782c..8b12fcf7f 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -304,7 +304,6 @@ class Pane extends Model if typeof item.onDidDestroy is 'function' @itemSubscriptions.set item, item.onDidDestroy => @removeItem(item, true) else if Grim.includeDeprecatedAPIs and typeof item.on is 'function' - Grim.deprecate 'If you would like your pane item to support removal when destroyed behavior, please implement a ::onDidDestroy() method. ::on methods for items are no longer supported. If not, ignore this message.' @subscribe item, 'destroyed', => @removeItem(item, true) @items.splice(index, 0, item) From c7071f15b52123e02d8c082704b9efca53bab3fe Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 14:43:49 -0700 Subject: [PATCH 26/70] :arrow_up: donna@1.0.10 --- build/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/package.json b/build/package.json index 18bef4d1e..212f9c3ed 100644 --- a/build/package.json +++ b/build/package.json @@ -7,7 +7,7 @@ }, "dependencies": { "async": "~0.2.9", - "donna": "1.0.9", + "donna": "1.0.10", "formidable": "~1.0.14", "fs-plus": "2.x", "github-releases": "~0.2.0", From b54177eb5eb4797f48057f3d7a1057cc6dedc7e0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 15:14:26 -0700 Subject: [PATCH 27/70] Remove property always set in constructor --- src/pane-container.coffee | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pane-container.coffee b/src/pane-container.coffee index 58da39872..e6eb97075 100644 --- a/src/pane-container.coffee +++ b/src/pane-container.coffee @@ -241,5 +241,3 @@ if Grim.includeDeprecatedAPIs @$activePane .switch((activePane) -> activePane?.$activeItem) .distinctUntilChanged() -else - PaneContainer::activePane = null From 5df56fc50ae2f5442ad82d1f9bd48ac31762de60 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 6 Apr 2015 12:30:12 -0700 Subject: [PATCH 28/70] Add workspace element command for 'add root folder' --- spec/atom-spec.coffee | 16 ++++++++++++++++ src/atom.coffee | 11 ++++++++--- src/workspace-element.coffee | 1 + 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/spec/atom-spec.coffee b/spec/atom-spec.coffee index 1fca9cf28..f888c433f 100644 --- a/spec/atom-spec.coffee +++ b/spec/atom-spec.coffee @@ -180,3 +180,19 @@ describe "the `atom` global", -> it "does not open an empty buffer", -> atom.openInitialEmptyEditorIfNecessary() expect(atom.workspace.open).not.toHaveBeenCalled() + + describe "adding a root folder", -> + it "adds a second path to the project", -> + initialPaths = atom.project.getPaths() + tempDirectory = temp.mkdirSync("a-new-directory") + spyOn(atom, "pickFolder").andCallFake (callback) -> + callback([tempDirectory]) + atom.addRootFolder() + expect(atom.project.getPaths()).toEqual(initialPaths.concat([tempDirectory])) + + it "does nothing if the user dismisses the file picker", -> + initialPaths = atom.project.getPaths() + tempDirectory = temp.mkdirSync("a-new-directory") + spyOn(atom, "pickFolder").andCallFake (callback) -> callback(null) + atom.addRootFolder() + expect(atom.project.getPaths()).toEqual(initialPaths) diff --git a/src/atom.coffee b/src/atom.coffee index 1710edd98..701f2e91e 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -412,10 +412,11 @@ class Atom extends Model open: (options) -> ipc.send('open', options) - # Extended: Show the native dialog to prompt the user to select a folder. + # Extended: Prompt the user to select one or more folders. # - # * `callback` A {Function} to call once the user has selected a folder. - # * `path` {String} the path to the folder the user selected. + # * `callback` A {Function} to call once the user has confirmed the selection. + # * `paths` An {Array} of {String} paths that the user selected, or `null` + # if the user dismissed the dialog. pickFolder: (callback) -> responseChannel = "atom-pick-folder-response" ipc.on responseChannel, (path) -> @@ -773,6 +774,10 @@ class Atom extends Model setRepresentedFilename: (filename) -> ipc.send('call-window-method', 'setRepresentedFilename', filename) + addRootFolder: -> + @pickFolder (selectedPaths = []) => + @project.addPath(selectedPath) for selectedPath in selectedPaths + showSaveDialog: (callback) -> callback(showSaveDialogSync()) diff --git a/src/workspace-element.coffee b/src/workspace-element.coffee index 33ea14093..ccf165439 100644 --- a/src/workspace-element.coffee +++ b/src/workspace-element.coffee @@ -138,6 +138,7 @@ atom.commands.add 'atom-workspace', 'application:open-safe': -> ipc.send('command', 'application:open-safe') 'application:open-api-preview': -> ipc.send('command', 'application:open-api-preview') 'application:open-dev-api-preview': -> ipc.send('command', 'application:open-dev-api-preview') + 'application:add-root-folder': -> atom.addRootFolder() 'application:minimize': -> ipc.send('command', 'application:minimize') 'application:zoom': -> ipc.send('command', 'application:zoom') 'application:bring-all-windows-to-front': -> ipc.send('command', 'application:bring-all-windows-to-front') From 4560be9eaeddbb2680bef1097a3169e1c574a3ae Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 15:53:25 -0700 Subject: [PATCH 29/70] Don't use deprecated atom.config.toggle --- src/workspace-element.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/workspace-element.coffee b/src/workspace-element.coffee index ccf165439..5f127d970 100644 --- a/src/workspace-element.coffee +++ b/src/workspace-element.coffee @@ -156,9 +156,9 @@ atom.commands.add 'atom-workspace', 'window:focus-pane-on-left': -> @focusPaneViewOnLeft() 'window:focus-pane-on-right': -> @focusPaneViewOnRight() 'window:save-all': -> @getModel().saveAll() - 'window:toggle-invisibles': -> atom.config.toggle("editor.showInvisibles") + 'window:toggle-invisibles': -> atom.config.set("editor.showInvisibles", !atom.config.get("editor.showInvisibles")) 'window:log-deprecation-warnings': -> Grim.logDeprecations() - 'window:toggle-auto-indent': -> atom.config.toggle("editor.autoIndent") + 'window:toggle-auto-indent': -> atom.config.set("editor.autoIndent", !atom.config.get("editor.autoIndent")) 'pane:reopen-closed-item': -> @getModel().reopenItem() 'core:close': -> @getModel().destroyActivePaneItemOrEmptyPane() 'core:save': -> @getModel().saveActivePaneItem() From 188b2e5a74e87ae98c1ce70986848d74d637ce03 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 15:55:51 -0700 Subject: [PATCH 30/70] Report core deprecations in specs --- spec/spec-helper.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 5406ff33a..70fb4fb58 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -72,7 +72,6 @@ if specDirectory isCoreSpec = specDirectory == fs.realpathSync(__dirname) beforeEach -> - Grim.clearDeprecations() if isCoreSpec $.fx.off = true documentTitle = null projectPath = specProjectPath ? path.join(@specDirectory, 'fixtures') From 50d9fee0d3ce00b6a1bbfe8a2f7a4249956d14f7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 16:21:09 -0700 Subject: [PATCH 31/70] Use Project::onDidAddBuffer --- spec/project-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/project-spec.coffee b/spec/project-spec.coffee index a1cdce662..703b3d4f8 100644 --- a/spec/project-spec.coffee +++ b/spec/project-spec.coffee @@ -221,7 +221,7 @@ describe "Project", -> beforeEach -> absolutePath = require.resolve('./fixtures/dir/a') newBufferHandler = jasmine.createSpy('newBufferHandler') - atom.project.on 'buffer-created', newBufferHandler + atom.project.onDidAddBuffer(newBufferHandler) describe "when given an absolute path that isn't currently open", -> it "returns a new edit session for the given path and emits 'buffer-created'", -> From 9b7870d5032607b6bd357c49cdf3feaa5cdb4154 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 16:22:31 -0700 Subject: [PATCH 32/70] Snapshot deprecations around calls to Project::eachBuffer --- spec/project-spec.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/project-spec.coffee b/spec/project-spec.coffee index 703b3d4f8..d89802243 100644 --- a/spec/project-spec.coffee +++ b/spec/project-spec.coffee @@ -502,8 +502,12 @@ describe "Project", -> describe ".eachBuffer(callback)", -> beforeEach -> + jasmine.snapshotDeprecations() atom.project.bufferForPathSync('a') + afterEach -> + jasmine.restoreDeprecationsSnapshot() + it "invokes the callback for existing buffer", -> count = 0 count = 0 From e02e8c91a6ce97b9a9d348ef297b27256203a700 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 16:29:12 -0700 Subject: [PATCH 33/70] Use TextEditor::onDidChangeCursorPosition in spec --- spec/text-editor-component-spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index a5ca4c309..b2ef2ec51 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -728,7 +728,7 @@ describe "TextEditorComponent", -> expect(cursorNodes[0].style['-webkit-transform']).toBe "translate(#{10 * charWidth}px, #{4 * lineHeightInPixels}px)" expect(cursorNodes[1].style['-webkit-transform']).toBe "translate(#{11 * charWidth}px, #{8 * lineHeightInPixels}px)" - wrapperView.on 'cursor:moved', cursorMovedListener = jasmine.createSpy('cursorMovedListener') + editor.onDidChangeCursorPosition cursorMovedListener = jasmine.createSpy('cursorMovedListener') cursor3.setScreenPosition([4, 11], autoscroll: false) nextAnimationFrame() expect(cursorNodes[0].style['-webkit-transform']).toBe "translate(#{11 * charWidth}px, #{4 * lineHeightInPixels}px)" From fdba094aa6b1bd987e6085989367a18c69eae68b Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 6 Apr 2015 17:12:50 -0700 Subject: [PATCH 34/70] :arrow_up: tree-view --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 55762cec0..ce1d886c4 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "symbols-view": "0.93.0", "tabs": "0.67.0", "timecop": "0.31.0", - "tree-view": "0.168.0", + "tree-view": "0.169.0", "update-package-dependencies": "0.9.0", "welcome": "0.26.0", "whitespace": "0.29.0", From a80256155344a7d175d14b80afddf258fbedafb3 Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 7 Apr 2015 09:20:27 +0900 Subject: [PATCH 35/70] :arrow_up: one-dark-ui@0.6.0 one-light-ui@0.5.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ce1d886c4..48f8a591c 100644 --- a/package.json +++ b/package.json @@ -76,10 +76,10 @@ "atom-light-ui": "0.41.0", "base16-tomorrow-dark-theme": "0.25.0", "base16-tomorrow-light-theme": "0.8.0", - "one-dark-ui": "0.5.0", + "one-dark-ui": "0.6.0", "one-dark-syntax": "0.3.0", "one-light-syntax": "0.4.0", - "one-light-ui": "0.4.0", + "one-light-ui": "0.5.0", "solarized-dark-syntax": "0.32.0", "solarized-light-syntax": "0.19.0", "archive-view": "0.55.0", From aed17cda9b43e96c6b31dd1f70199d3742b904ff Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Apr 2015 17:51:18 -0700 Subject: [PATCH 36/70] :arrow_up: language-javascript@0.69 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 48f8a591c..d6abef9c6 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "language-html": "0.31.0", "language-hyperlink": "0.12.2", "language-java": "0.14.0", - "language-javascript": "0.68.0", + "language-javascript": "0.69.0", "language-json": "0.14.0", "language-less": "0.25.0", "language-make": "0.14.0", From a6d47d403fc68ef9e0c29635a5427dff4d5ecfe9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Apr 2015 11:01:54 +0800 Subject: [PATCH 37/70] :penguin: Don't use clipboard in renderer process, fixes #6221 --- src/clipboard.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/clipboard.coffee b/src/clipboard.coffee index 3fba6f4e8..bc0926521 100644 --- a/src/clipboard.coffee +++ b/src/clipboard.coffee @@ -1,6 +1,12 @@ -clipboard = require 'clipboard' crypto = require 'crypto' +# Using clipboard in renderer process is not safe on Linux. +clipboard = + if process.platform is 'linux' + require('remote').require 'clipboard' + else + require 'clipboard' + # Extended: Represents the clipboard used for copying and pasting in Atom. # # An instance of this class is always available as the `atom.clipboard` global. From 099c8eda77763d0c38b0c67ef947c7a228e0a1f7 Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 7 Apr 2015 12:33:44 +0900 Subject: [PATCH 38/70] :arrow_up: status-bar@v0.67.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d6abef9c6..f8ebc304d 100644 --- a/package.json +++ b/package.json @@ -113,7 +113,7 @@ "settings-view": "0.187.0", "snippets": "0.88.0", "spell-check": "0.55.0", - "status-bar": "0.66.0", + "status-bar": "0.67.0", "styleguide": "0.44.0", "symbols-view": "0.93.0", "tabs": "0.67.0", From ef19b6ab223e7a9488cd8fa194f507d5f4bbc284 Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 7 Apr 2015 15:20:29 +0900 Subject: [PATCH 39/70] :arrow_up: find-and-replace@v0.160.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f8ebc304d..8f75a4a85 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "encoding-selector": "0.19.0", "exception-reporting": "0.24.0", "feedback": "0.38.0", - "find-and-replace": "0.159.0", + "find-and-replace": "0.160.0", "fuzzy-finder": "0.72.0", "git-diff": "0.54.0", "go-to-line": "0.30.0", From 2e86e22d46fb22ab1a4acd8e011155ccf41b35ff Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 7 Apr 2015 16:42:50 +0900 Subject: [PATCH 40/70] :arrrow_up: one-dark-ui@v0.6.1 one-light-ui@v0.5.1 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8f75a4a85..9dc9ad061 100644 --- a/package.json +++ b/package.json @@ -76,10 +76,10 @@ "atom-light-ui": "0.41.0", "base16-tomorrow-dark-theme": "0.25.0", "base16-tomorrow-light-theme": "0.8.0", - "one-dark-ui": "0.6.0", + "one-dark-ui": "0.6.1", "one-dark-syntax": "0.3.0", "one-light-syntax": "0.4.0", - "one-light-ui": "0.5.0", + "one-light-ui": "0.5.1", "solarized-dark-syntax": "0.32.0", "solarized-light-syntax": "0.19.0", "archive-view": "0.55.0", From 5e5acb7432ff6cfe0f67468c5d0ab66e85caa0d7 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 7 Apr 2015 12:24:41 +0200 Subject: [PATCH 41/70] :art: Rename to `TextEditor#mergeSelectionsOnSameRows` * :fire: Delete `Selection#intersectsByRowWith` --- src/selection.coffee | 12 ------------ src/text-editor.coffee | 6 +++--- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/selection.coffee b/src/selection.coffee index 49aa2c6b1..91f942524 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -162,18 +162,6 @@ class Selection extends Model intersectsScreenRow: (screenRow) -> @getScreenRange().intersectsRow(screenRow) - # Public: Identifies if this selection's rows intersects with another selection's rows. - # - # * `otherSelection` A {Selection} to check against. - # - # Returns a {Boolean} - intersectsByRowWith: (otherSelection) -> - otherScreenRange = otherSelection.getScreenRange() - - @getScreenRange().intersectsRowRange( - otherScreenRange.start.row, otherScreenRange.end.row - ) - # Public: Identifies if a selection intersects with another selection. # # * `otherSelection` A {Selection} to check against. diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 6395ccc32..8936e125a 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -1026,7 +1026,7 @@ class TextEditor extends Model # Extended: Delete all lines intersecting selections. deleteLine: -> - @mergeIntersectingSelectionsByRow() + @mergeSelectionsOnSameRows() @mutateSelectedText (selection) -> selection.deleteLine() ### @@ -2054,9 +2054,9 @@ class TextEditor extends Model previousSelection.intersectsWith(currentSelection, exclusive) - mergeIntersectingSelectionsByRow: (args...) -> + mergeSelectionsOnSameRows: (args...) -> @mergeSelections args..., (previousSelection, currentSelection) -> - previousSelection.intersectsByRowWith(currentSelection) + previousSelection.intersectsScreenRowRange(currentSelection.getBufferRowRange()...) mergeSelections: (args...) -> mergePredicate = args.pop() From a244c0fa072bbd36122849268e58766f402672ef Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 7 Apr 2015 12:30:51 +0200 Subject: [PATCH 42/70] :fire: Delete useless line in spec --- spec/text-editor-spec.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index 05cc666c3..3dfbce82e 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -3373,7 +3373,6 @@ describe "TextEditor", -> it "deletes a line only once when multiple selections are on the same line", -> line1 = buffer.lineForRow(1) count = buffer.getLineCount() - editor.getLastCursor().moveToTop() editor.setSelectedBufferRanges([ [[0, 1], [0, 2]], [[0, 4], [0, 5]] From 9dddce495e19dfffb7cb494218dbd41ff867d1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C5=BDu=C5=BEak?= Date: Tue, 7 Apr 2015 12:41:06 +0200 Subject: [PATCH 43/70] :arrow_up: notifications@0.36.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9dc9ad061..9d71a3dc4 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "link": "0.30.0", "markdown-preview": "0.148.0", "metrics": "0.45.0", - "notifications": "0.35.0", + "notifications": "0.36.0", "open-on-github": "0.36.0", "package-generator": "0.38.0", "release-notes": "0.52.0", From 662efb3d6ec8b9ea5b7abfbfccd254c15e90b45a Mon Sep 17 00:00:00 2001 From: simurai Date: Tue, 7 Apr 2015 19:57:24 +0900 Subject: [PATCH 44/70] :arrrow_up: one-dark-ui@v0.6.2 one-light-ui@v0.5.2 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9d71a3dc4..cf2ae12b4 100644 --- a/package.json +++ b/package.json @@ -76,10 +76,10 @@ "atom-light-ui": "0.41.0", "base16-tomorrow-dark-theme": "0.25.0", "base16-tomorrow-light-theme": "0.8.0", - "one-dark-ui": "0.6.1", + "one-dark-ui": "0.6.2", "one-dark-syntax": "0.3.0", "one-light-syntax": "0.4.0", - "one-light-ui": "0.5.1", + "one-light-ui": "0.5.2", "solarized-dark-syntax": "0.32.0", "solarized-light-syntax": "0.19.0", "archive-view": "0.55.0", From 36641884f904f6ae1f8744ab77612e8599653bed Mon Sep 17 00:00:00 2001 From: Ivan Zuzak Date: Tue, 7 Apr 2015 13:37:30 +0200 Subject: [PATCH 45/70] Point in-app link for reporting issues to CONTRIBUTING guide --- 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 45c0c8b5c..9922a1380 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -169,7 +169,7 @@ class AtomApplication @on 'application:open-roadmap', -> require('shell').openExternal('https://atom.io/roadmap?app') @on 'application:open-faq', -> require('shell').openExternal('https://atom.io/faq') @on 'application:open-terms-of-use', -> require('shell').openExternal('https://atom.io/terms') - @on 'application:report-issue', -> require('shell').openExternal('https://github.com/atom/atom/issues/new') + @on 'application:report-issue', -> require('shell').openExternal('https://github.com/atom/atom/blob/master/CONTRIBUTING.md#submitting-issues') @on 'application:search-issues', -> require('shell').openExternal('https://github.com/issues?q=+is%3Aissue+user%3Aatom') @on 'application:install-update', -> @autoUpdateManager.install() From 4a95dd1234a5bbabed09583d387e8de6601ae7fd Mon Sep 17 00:00:00 2001 From: Ivan Zuzak Date: Tue, 7 Apr 2015 13:38:57 +0200 Subject: [PATCH 46/70] Update CONTRIBUTING guide section on reporting issues --- CONTRIBUTING.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2a5ba9945..66080c614 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,13 +4,14 @@ The following is a set of guidelines for contributing to Atom and its packages, which are hosted in the [Atom Organization](https://github.com/atom) on GitHub. -If you're unsure which package is causing your problem or if you're having an -issue with Atom core, please open an issue on the [main atom repository](https://github.com/atom/atom/issues). These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request. ## Submitting Issues +* You can create an issue [here](https://github.com/atom/atom/issues/new), but + before doing that please read the notes below on debugging and submitting issues, + and include as many details as possible with your report. * Check the [debugging guide](https://atom.io/docs/latest/hacking-atom-debugging) for tips on debugging. You might be able to find the cause of the problem and fix things yourself. @@ -24,7 +25,8 @@ propose changes to this document in a pull request. will be logged. If you can reproduce the error, use this approach to get the full stack trace and include it in the issue. * On Mac, check Console.app for stack traces to include if reporting a crash. -* Perform a cursory search to see if a similar issue has already been submitted. +* Perform a [cursory search](https://github.com/issues?q=+is%3Aissue+user%3Aatom) + to see if a similar issue has already been submitted. * Please setup a [profile picture](https://help.github.com/articles/how-do-i-set-up-my-profile-picture) to make yourself recognizable and so we can all get to know each other better. @@ -38,6 +40,10 @@ many packages and themes that are stored in other repos under the [language-javascript](https://github.com/atom/language-javascript), and [atom-light-ui](https://github.com/atom/atom-light-ui). +If your issue is related to a specific package, open an issue on that package's +issue tracker. If you're unsure which package is causing your problem or if +you're having an issue with Atom core, open an issue on this repository. + For more information on how to work with Atom's official packages, see [Contributing to Atom Packages](https://github.com/atom/atom/blob/master/docs/contributing-to-packages.md) From cbf499243e0787b33ca486ec6c9a396d4cd74f31 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 7 Apr 2015 18:08:51 +0200 Subject: [PATCH 47/70] Use screen ranges consistently --- src/text-editor.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 8936e125a..7606cea7e 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -2056,7 +2056,9 @@ class TextEditor extends Model mergeSelectionsOnSameRows: (args...) -> @mergeSelections args..., (previousSelection, currentSelection) -> - previousSelection.intersectsScreenRowRange(currentSelection.getBufferRowRange()...) + screenRange = currentSelection.getScreenRange() + + previousSelection.intersectsScreenRowRange(screenRange.start.row, screenRange.end.row) mergeSelections: (args...) -> mergePredicate = args.pop() From c0b685dd970ca8d72f4197c7f999ad2224fcb1e3 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 09:48:10 -0700 Subject: [PATCH 48/70] :arrow_up: language-go@0.23 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cf2ae12b4..50bd77e28 100644 --- a/package.json +++ b/package.json @@ -130,7 +130,7 @@ "language-css": "0.28.0", "language-gfm": "0.67.0", "language-git": "0.10.0", - "language-go": "0.22.0", + "language-go": "0.23.0", "language-html": "0.31.0", "language-hyperlink": "0.12.2", "language-java": "0.14.0", From 2aaf1fffe6eece195db41c3ea344b9195a054823 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 09:51:16 -0700 Subject: [PATCH 49/70] Move stack trace helpers into deprecation block --- src/workspace.coffee | 59 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index 6a7a40a0c..2e433d6b9 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -7,7 +7,6 @@ Serializable = require 'serializable' {Emitter, Disposable, CompositeDisposable} = require 'event-kit' Grim = require 'grim' fs = require 'fs-plus' -StackTraceParser = require 'stacktrace-parser' Model = require './model' TextEditor = require './text-editor' PaneContainer = require './pane-container' @@ -495,34 +494,6 @@ class Workspace extends Model getOpeners: -> @openers - getCallingPackageName: -> - error = new Error - Error.captureStackTrace(error) - stack = StackTraceParser.parse(error.stack) - - packagePaths = @getPackagePathsByPackageName() - - for i in [0...stack.length] - stackFramePath = stack[i].file - - # Empty when it was run from the dev console - return unless stackFramePath - - for packageName, packagePath of packagePaths - continue if stackFramePath is 'node.js' - relativePath = path.relative(packagePath, stackFramePath) - return packageName unless /^\.\./.test(relativePath) - return - - getPackagePathsByPackageName: -> - packagePathsByPackageName = {} - for pack in atom.packages.getLoadedPackages() - packagePath = pack.path - if packagePath.indexOf('.atom/dev/packages') > -1 or packagePath.indexOf('.atom/packages') > -1 - packagePath = fs.realpathSync(packagePath) - packagePathsByPackageName[pack.name] = packagePath - packagePathsByPackageName - ### Section: Pane Items ### @@ -907,6 +878,36 @@ if includeDeprecatedAPIs Grim.deprecate "Use ::getActivePane() instead of the ::activePane property" @getActivePane() + StackTraceParser = require 'stacktrace-parser' + + Workspace::getCallingPackageName = -> + error = new Error + Error.captureStackTrace(error) + stack = StackTraceParser.parse(error.stack) + + packagePaths = @getPackagePathsByPackageName() + + for i in [0...stack.length] + stackFramePath = stack[i].file + + # Empty when it was run from the dev console + return unless stackFramePath + + for packageName, packagePath of packagePaths + continue if stackFramePath is 'node.js' + relativePath = path.relative(packagePath, stackFramePath) + return packageName unless /^\.\./.test(relativePath) + return + + Workspace::getPackagePathsByPackageName = -> + packagePathsByPackageName = {} + for pack in atom.packages.getLoadedPackages() + packagePath = pack.path + if packagePath.indexOf('.atom/dev/packages') > -1 or packagePath.indexOf('.atom/packages') > -1 + packagePath = fs.realpathSync(packagePath) + packagePathsByPackageName[pack.name] = packagePath + packagePathsByPackageName + Workspace::eachEditor = (callback) -> deprecate("Use Workspace::observeTextEditors instead") From 9a647309167973a0d0bb76e455406229fec28e21 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 7 Apr 2015 11:23:22 -0700 Subject: [PATCH 50/70] :arrow_up: background-tips --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 50bd77e28..0360f085e 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "autocomplete": "0.44.0", "autoflow": "0.22.0", "autosave": "0.20.0", - "background-tips": "0.23.0", + "background-tips": "0.24.0", "bookmarks": "0.35.0", "bracket-matcher": "0.73.0", "command-palette": "0.35.0", From 06b8195fb8de1fe21755f1469004d11498280aec Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 11:43:35 -0700 Subject: [PATCH 51/70] Remove template config.cson file This old template file had several problems: * The entries in this file are already the schema defaults so they would get unset anyway when initially loaded * The file was in the old format that didn't have scope selectors * A race condition could occur when the file was copied, inited, and written to all during the very first run of Atom. Closes #6226 --- dot-atom/config.cson | 7 ------- spec/config-spec.coffee | 1 - 2 files changed, 8 deletions(-) delete mode 100644 dot-atom/config.cson diff --git a/dot-atom/config.cson b/dot-atom/config.cson deleted file mode 100644 index a3a5984af..000000000 --- a/dot-atom/config.cson +++ /dev/null @@ -1,7 +0,0 @@ -'editor': - 'fontSize': 16 -'core': - 'themes': [ - 'one-dark-ui' - 'one-dark-syntax' - ] diff --git a/spec/config-spec.coffee b/spec/config-spec.coffee index 4abd3b0db..b8cfc67d0 100644 --- a/spec/config-spec.coffee +++ b/spec/config-spec.coffee @@ -987,7 +987,6 @@ describe "Config", -> expect(fs.existsSync(atom.config.configDirPath)).toBeTruthy() expect(fs.existsSync(path.join(atom.config.configDirPath, 'packages'))).toBeTruthy() expect(fs.isFileSync(path.join(atom.config.configDirPath, 'snippets.cson'))).toBeTruthy() - expect(fs.isFileSync(path.join(atom.config.configDirPath, 'config.cson'))).toBeTruthy() expect(fs.isFileSync(path.join(atom.config.configDirPath, 'init.coffee'))).toBeTruthy() expect(fs.isFileSync(path.join(atom.config.configDirPath, 'styles.less'))).toBeTruthy() From 4421d929a74d5fa867b8d88190947f26bee093fa Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 11:54:58 -0700 Subject: [PATCH 52/70] :arrow_up: language-javascript@0.70 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0360f085e..92a133ad6 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "language-html": "0.31.0", "language-hyperlink": "0.12.2", "language-java": "0.14.0", - "language-javascript": "0.69.0", + "language-javascript": "0.70.0", "language-json": "0.14.0", "language-less": "0.25.0", "language-make": "0.14.0", From f39c67411aabb0c6dbb1ccd3dc68f051aa3bb0d7 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 7 Apr 2015 11:59:14 -0700 Subject: [PATCH 53/70] Rename 'add-root-folder' -> 'add-project-folder' --- spec/atom-spec.coffee | 6 +++--- src/atom.coffee | 2 +- src/workspace-element.coffee | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/atom-spec.coffee b/spec/atom-spec.coffee index f888c433f..19a2cca5c 100644 --- a/spec/atom-spec.coffee +++ b/spec/atom-spec.coffee @@ -181,18 +181,18 @@ describe "the `atom` global", -> atom.openInitialEmptyEditorIfNecessary() expect(atom.workspace.open).not.toHaveBeenCalled() - describe "adding a root folder", -> + describe "adding a project folder", -> it "adds a second path to the project", -> initialPaths = atom.project.getPaths() tempDirectory = temp.mkdirSync("a-new-directory") spyOn(atom, "pickFolder").andCallFake (callback) -> callback([tempDirectory]) - atom.addRootFolder() + atom.addProjectFolder() expect(atom.project.getPaths()).toEqual(initialPaths.concat([tempDirectory])) it "does nothing if the user dismisses the file picker", -> initialPaths = atom.project.getPaths() tempDirectory = temp.mkdirSync("a-new-directory") spyOn(atom, "pickFolder").andCallFake (callback) -> callback(null) - atom.addRootFolder() + atom.addProjectFolder() expect(atom.project.getPaths()).toEqual(initialPaths) diff --git a/src/atom.coffee b/src/atom.coffee index 701f2e91e..f5e229962 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -774,7 +774,7 @@ class Atom extends Model setRepresentedFilename: (filename) -> ipc.send('call-window-method', 'setRepresentedFilename', filename) - addRootFolder: -> + addProjectFolder: -> @pickFolder (selectedPaths = []) => @project.addPath(selectedPath) for selectedPath in selectedPaths diff --git a/src/workspace-element.coffee b/src/workspace-element.coffee index 5f127d970..46a005af0 100644 --- a/src/workspace-element.coffee +++ b/src/workspace-element.coffee @@ -138,7 +138,7 @@ atom.commands.add 'atom-workspace', 'application:open-safe': -> ipc.send('command', 'application:open-safe') 'application:open-api-preview': -> ipc.send('command', 'application:open-api-preview') 'application:open-dev-api-preview': -> ipc.send('command', 'application:open-dev-api-preview') - 'application:add-root-folder': -> atom.addRootFolder() + 'application:add-project-folder': -> atom.addProjectFolder() 'application:minimize': -> ipc.send('command', 'application:minimize') 'application:zoom': -> ipc.send('command', 'application:zoom') 'application:bring-all-windows-to-front': -> ipc.send('command', 'application:bring-all-windows-to-front') From ceaa86942673d583b6b9867182d27c6d97ecf740 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 12:33:41 -0700 Subject: [PATCH 54/70] Add application:add-project-folder keybinding --- keymaps/darwin.cson | 1 + keymaps/linux.cson | 1 + keymaps/win32.cson | 1 + 3 files changed, 3 insertions(+) diff --git a/keymaps/darwin.cson b/keymaps/darwin.cson index 5226bb5e6..46f949317 100644 --- a/keymaps/darwin.cson +++ b/keymaps/darwin.cson @@ -37,6 +37,7 @@ 'cmd-N': 'application:new-window' 'cmd-W': 'window:close' 'cmd-o': 'application:open' + 'cmd-alt-o': 'application:add-project-folder' 'cmd-T': 'pane:reopen-closed-item' 'cmd-n': 'application:new-file' 'cmd-s': 'core:save' diff --git a/keymaps/linux.cson b/keymaps/linux.cson index 59803d193..cea470635 100644 --- a/keymaps/linux.cson +++ b/keymaps/linux.cson @@ -21,6 +21,7 @@ 'ctrl-N': 'application:new-window' 'ctrl-W': 'window:close' 'ctrl-o': 'application:open-file' + 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-q': 'application:quit' 'ctrl-T': 'pane:reopen-closed-item' 'ctrl-n': 'application:new-file' diff --git a/keymaps/win32.cson b/keymaps/win32.cson index da43ac364..382b280a8 100644 --- a/keymaps/win32.cson +++ b/keymaps/win32.cson @@ -25,6 +25,7 @@ 'ctrl-N': 'application:new-window' 'ctrl-W': 'window:close' 'ctrl-o': 'application:open-file' + 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-T': 'pane:reopen-closed-item' 'ctrl-n': 'application:new-file' 'ctrl-s': 'core:save' From 54c238ba2d02c60884041df5236172c760274396 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 7 Apr 2015 12:34:08 -0700 Subject: [PATCH 55/70] :arrow_up: tree-view --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 92a133ad6..26dc284a1 100644 --- a/package.json +++ b/package.json @@ -118,7 +118,7 @@ "symbols-view": "0.93.0", "tabs": "0.67.0", "timecop": "0.31.0", - "tree-view": "0.169.0", + "tree-view": "0.170.0", "update-package-dependencies": "0.9.0", "welcome": "0.26.0", "whitespace": "0.29.0", From 8e0efb184480a9be5bd184634741970f29e97bea Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 12:34:36 -0700 Subject: [PATCH 56/70] Add Add Project Folder system menu --- menus/darwin.cson | 1 + menus/linux.cson | 1 + menus/win32.cson | 1 + 3 files changed, 3 insertions(+) diff --git a/menus/darwin.cson b/menus/darwin.cson index 9454a7c34..effd19197 100644 --- a/menus/darwin.cson +++ b/menus/darwin.cson @@ -34,6 +34,7 @@ { label: 'New Window', command: 'application:new-window' } { label: 'New File', command: 'application:new-file' } { label: 'Open...', command: 'application:open' } + { label: 'Add Project Folder...', command: 'application:add-project-folder' } { label: 'Reopen Last Item', command: 'pane:reopen-closed-item' } { type: 'separator' } { label: 'Save', command: 'core:save' } diff --git a/menus/linux.cson b/menus/linux.cson index a3b3875c4..c92017de9 100644 --- a/menus/linux.cson +++ b/menus/linux.cson @@ -6,6 +6,7 @@ { label: '&New File', command: 'application:new-file' } { label: '&Open File...', command: 'application:open-file' } { label: 'Open Folder...', command: 'application:open-folder' } + { label: 'Add Project Folder...', command: 'application:add-project-folder' } { label: 'Reopen Last &Item', command: 'pane:reopen-closed-item' } { type: 'separator' } { label: '&Save', command: 'core:save' } diff --git a/menus/win32.cson b/menus/win32.cson index af26be7a5..2bd013ce3 100644 --- a/menus/win32.cson +++ b/menus/win32.cson @@ -6,6 +6,7 @@ { label: '&New File', command: 'application:new-file' } { label: '&Open File...', command: 'application:open-file' } { label: 'Open Folder...', command: 'application:open-folder' } + { label: 'Add Project Folder...', command: 'application:add-project-folder' } { label: 'Reopen Last &Item', command: 'pane:reopen-closed-item' } { type: 'separator' } { label: 'Se&ttings', command: 'application:show-settings' } From 1acc3a835673c7df91330ef482e800506c030647 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 12:41:59 -0700 Subject: [PATCH 57/70] Don't clash with existing linux/windows keybindings --- keymaps/linux.cson | 2 +- keymaps/win32.cson | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keymaps/linux.cson b/keymaps/linux.cson index cea470635..fed3bdc49 100644 --- a/keymaps/linux.cson +++ b/keymaps/linux.cson @@ -21,7 +21,7 @@ 'ctrl-N': 'application:new-window' 'ctrl-W': 'window:close' 'ctrl-o': 'application:open-file' - 'ctrl-alt-o': 'application:add-project-folder' + 'ctrl-alt-O': 'application:add-project-folder' 'ctrl-q': 'application:quit' 'ctrl-T': 'pane:reopen-closed-item' 'ctrl-n': 'application:new-file' diff --git a/keymaps/win32.cson b/keymaps/win32.cson index 382b280a8..d5e331f0c 100644 --- a/keymaps/win32.cson +++ b/keymaps/win32.cson @@ -25,7 +25,7 @@ 'ctrl-N': 'application:new-window' 'ctrl-W': 'window:close' 'ctrl-o': 'application:open-file' - 'ctrl-alt-o': 'application:add-project-folder' + 'ctrl-alt-O': 'application:add-project-folder' 'ctrl-T': 'pane:reopen-closed-item' 'ctrl-n': 'application:new-file' 'ctrl-s': 'core:save' From d41296b121bf2d2ed97992285aef3d9c6e136e61 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 13:02:11 -0700 Subject: [PATCH 58/70] Swap open-dev and add-project-folder keybindings --- keymaps/darwin.cson | 4 ++-- keymaps/linux.cson | 4 ++-- keymaps/win32.cson | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keymaps/darwin.cson b/keymaps/darwin.cson index 46f949317..8f023427e 100644 --- a/keymaps/darwin.cson +++ b/keymaps/darwin.cson @@ -18,7 +18,7 @@ 'ctrl-d': 'core:delete' # Atom Specific - 'cmd-O': 'application:open-dev' + 'cmd-alt-o': 'application:open-dev' 'cmd-alt-ctrl-s': 'application:run-all-specs' 'enter': 'core:confirm' 'escape': 'core:cancel' @@ -37,7 +37,7 @@ 'cmd-N': 'application:new-window' 'cmd-W': 'window:close' 'cmd-o': 'application:open' - 'cmd-alt-o': 'application:add-project-folder' + 'cmd-O': 'application:add-project-folder' 'cmd-T': 'pane:reopen-closed-item' 'cmd-n': 'application:new-file' 'cmd-s': 'core:save' diff --git a/keymaps/linux.cson b/keymaps/linux.cson index fed3bdc49..6fef9f482 100644 --- a/keymaps/linux.cson +++ b/keymaps/linux.cson @@ -10,7 +10,7 @@ 'ctrl-shift-i': 'window:toggle-dev-tools' 'ctrl-alt-p': 'window:run-package-specs' 'ctrl-alt-s': 'application:run-all-specs' - 'ctrl-alt-o': 'application:open-dev' + 'ctrl-alt-shift-o': 'application:open-dev' 'ctrl-shift-o': 'application:open-folder' 'ctrl-shift-pageup': 'pane:move-item-left' 'ctrl-shift-pagedown': 'pane:move-item-right' @@ -21,7 +21,7 @@ 'ctrl-N': 'application:new-window' 'ctrl-W': 'window:close' 'ctrl-o': 'application:open-file' - 'ctrl-alt-O': 'application:add-project-folder' + 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-q': 'application:quit' 'ctrl-T': 'pane:reopen-closed-item' 'ctrl-n': 'application:new-file' diff --git a/keymaps/win32.cson b/keymaps/win32.cson index d5e331f0c..968adb0a8 100644 --- a/keymaps/win32.cson +++ b/keymaps/win32.cson @@ -14,7 +14,7 @@ 'ctrl-alt-i': 'window:toggle-dev-tools' 'ctrl-alt-p': 'window:run-package-specs' 'ctrl-alt-s': 'application:run-all-specs' - 'ctrl-alt-o': 'application:open-dev' + 'ctrl-alt-shift-o': 'application:open-dev' 'ctrl-shift-o': 'application:open-folder' 'ctrl-shift-left': 'pane:move-item-left' 'ctrl-shift-right': 'pane:move-item-right' @@ -25,7 +25,7 @@ 'ctrl-N': 'application:new-window' 'ctrl-W': 'window:close' 'ctrl-o': 'application:open-file' - 'ctrl-alt-O': 'application:add-project-folder' + 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-T': 'pane:reopen-closed-item' 'ctrl-n': 'application:new-file' 'ctrl-s': 'core:save' From b9db13ae064facbb9dc27650ffec254d7e08fe4e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 13:05:28 -0700 Subject: [PATCH 59/70] Group add-project-folder with open-folder --- keymaps/linux.cson | 2 +- keymaps/win32.cson | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keymaps/linux.cson b/keymaps/linux.cson index 6fef9f482..d8877d77c 100644 --- a/keymaps/linux.cson +++ b/keymaps/linux.cson @@ -12,6 +12,7 @@ 'ctrl-alt-s': 'application:run-all-specs' 'ctrl-alt-shift-o': 'application:open-dev' 'ctrl-shift-o': 'application:open-folder' + 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-shift-pageup': 'pane:move-item-left' 'ctrl-shift-pagedown': 'pane:move-item-right' 'F11': 'window:toggle-full-screen' @@ -21,7 +22,6 @@ 'ctrl-N': 'application:new-window' 'ctrl-W': 'window:close' 'ctrl-o': 'application:open-file' - 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-q': 'application:quit' 'ctrl-T': 'pane:reopen-closed-item' 'ctrl-n': 'application:new-file' diff --git a/keymaps/win32.cson b/keymaps/win32.cson index 968adb0a8..4d5bb5159 100644 --- a/keymaps/win32.cson +++ b/keymaps/win32.cson @@ -16,6 +16,7 @@ 'ctrl-alt-s': 'application:run-all-specs' 'ctrl-alt-shift-o': 'application:open-dev' 'ctrl-shift-o': 'application:open-folder' + 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-shift-left': 'pane:move-item-left' 'ctrl-shift-right': 'pane:move-item-right' 'F11': 'window:toggle-full-screen' @@ -25,7 +26,6 @@ 'ctrl-N': 'application:new-window' 'ctrl-W': 'window:close' 'ctrl-o': 'application:open-file' - 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-T': 'pane:reopen-closed-item' 'ctrl-n': 'application:new-file' 'ctrl-s': 'core:save' From a49f635fc0ba1d952320d6710d75731e7a106717 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 13:10:01 -0700 Subject: [PATCH 60/70] Remove application:open-dev keybindings --- keymaps/darwin.cson | 1 - keymaps/linux.cson | 1 - keymaps/win32.cson | 1 - 3 files changed, 3 deletions(-) diff --git a/keymaps/darwin.cson b/keymaps/darwin.cson index 8f023427e..34d18e159 100644 --- a/keymaps/darwin.cson +++ b/keymaps/darwin.cson @@ -18,7 +18,6 @@ 'ctrl-d': 'core:delete' # Atom Specific - 'cmd-alt-o': 'application:open-dev' 'cmd-alt-ctrl-s': 'application:run-all-specs' 'enter': 'core:confirm' 'escape': 'core:cancel' diff --git a/keymaps/linux.cson b/keymaps/linux.cson index d8877d77c..cd71d99e7 100644 --- a/keymaps/linux.cson +++ b/keymaps/linux.cson @@ -10,7 +10,6 @@ 'ctrl-shift-i': 'window:toggle-dev-tools' 'ctrl-alt-p': 'window:run-package-specs' 'ctrl-alt-s': 'application:run-all-specs' - 'ctrl-alt-shift-o': 'application:open-dev' 'ctrl-shift-o': 'application:open-folder' 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-shift-pageup': 'pane:move-item-left' diff --git a/keymaps/win32.cson b/keymaps/win32.cson index 4d5bb5159..656d9ec8e 100644 --- a/keymaps/win32.cson +++ b/keymaps/win32.cson @@ -14,7 +14,6 @@ 'ctrl-alt-i': 'window:toggle-dev-tools' 'ctrl-alt-p': 'window:run-package-specs' 'ctrl-alt-s': 'application:run-all-specs' - 'ctrl-alt-shift-o': 'application:open-dev' 'ctrl-shift-o': 'application:open-folder' 'ctrl-alt-o': 'application:add-project-folder' 'ctrl-shift-left': 'pane:move-item-left' From debe192d9eb34bba10769b8c61b62cbcb7863a33 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 14:14:46 -0700 Subject: [PATCH 61/70] Prepare 0.191 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 26dc284a1..9b30cb63f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "atom", "productName": "Atom", - "version": "0.190.0", + "version": "0.191.0", "description": "A hackable text editor for the 21st Century.", "main": "./src/browser/main.js", "repository": { From ff86712a22e3def0b2014095dd06de0eef60d53d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 14:15:30 -0700 Subject: [PATCH 62/70] Add missing View > Panes menu on Linux Closes #1897 --- menus/linux.cson | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/menus/linux.cson b/menus/linux.cson index c92017de9..2cfb17871 100644 --- a/menus/linux.cson +++ b/menus/linux.cson @@ -96,6 +96,25 @@ { label: '&Reload', command: 'window:reload' } { label: 'Toggle &Full Screen', command: 'window:toggle-full-screen' } { label: 'Toggle Menu Bar', command: 'window:toggle-menu-bar' } + { + label: 'Panes' + submenu: [ + { label: 'Split Up', command: 'pane:split-up' } + { label: 'Split Down', command: 'pane:split-down' } + { label: 'Split Left', command: 'pane:split-left' } + { label: 'Split Right', command: 'pane:split-right' } + { type: 'separator' } + { label: 'Focus Next Pane', command: 'window:focus-next-pane' } + { label: 'Focus Previous Pane', command: 'window:focus-previous-pane' } + { type: 'separator' } + { label: 'Focus Pane Above', command: 'window:focus-pane-above' } + { label: 'Focus Pane Below', command: 'window:focus-pane-below' } + { label: 'Focus Pane On Left', command: 'window:focus-pane-on-left' } + { label: 'Focus Pane On Right', command: 'window:focus-pane-on-right' } + { type: 'separator' } + { label: 'Close Pane', command: 'pane:close' } + ] + } { label: 'Developer' submenu: [ From 2a95b18ffd6548cca99cfc66cceb4f7f2729786f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 14:38:26 -0700 Subject: [PATCH 63/70] :arrow_up: deprecation-cop@0.40 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9b30cb63f..9e9b716d5 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "bookmarks": "0.35.0", "bracket-matcher": "0.73.0", "command-palette": "0.35.0", - "deprecation-cop": "0.39.0", + "deprecation-cop": "0.40.0", "dev-live-reload": "0.45.0", "encoding-selector": "0.19.0", "exception-reporting": "0.24.0", From baae0c0ac680a717be6033474baa2e3eee111172 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 14:40:27 -0700 Subject: [PATCH 64/70] Only include emissary Emitter in deprecation mode --- src/config.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.coffee b/src/config.coffee index f7db867ed..918a18848 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -1,6 +1,5 @@ _ = require 'underscore-plus' fs = require 'fs-plus' -EmitterMixin = require('emissary').Emitter {CompositeDisposable, Disposable, Emitter} = require 'event-kit' CSON = require 'season' path = require 'path' @@ -290,7 +289,6 @@ ScopeDescriptor = require './scope-descriptor' # module.exports = class Config - EmitterMixin.includeInto(this) @schemaEnforcers = {} @addSchemaEnforcer: (typeName, enforcerFunction) -> @@ -1147,6 +1145,9 @@ withoutEmptyObjects = (object) -> resultObject if Grim.includeDeprecatedAPIs + EmitterMixin = require('emissary').Emitter + EmitterMixin.includeInto(Config) + Config::restoreDefault = (scopeSelector, keyPath) -> Grim.deprecate("Use ::unset instead.") @unset(scopeSelector, keyPath) From e71c6b10611de175b1414842079464a74b4a9ffa Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 14:41:45 -0700 Subject: [PATCH 65/70] Remove unused require --- src/project.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/src/project.coffee b/src/project.coffee index 5094ef8ce..49d7fe295 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -5,7 +5,6 @@ _ = require 'underscore-plus' fs = require 'fs-plus' Q = require 'q' {includeDeprecatedAPIs, deprecate} = require 'grim' -{Subscriber} = require 'emissary' {Emitter} = require 'event-kit' Serializable = require 'serializable' TextBuffer = require 'text-buffer' From 4b764f4a59a131d3775ac93b40c17f36b620923b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 14:43:27 -0700 Subject: [PATCH 66/70] Move emissary require to deprecation block --- 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 7606cea7e..02e7b9ba6 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -3,7 +3,6 @@ path = require 'path' Serializable = require 'serializable' Delegator = require 'delegato' {includeDeprecatedAPIs, deprecate} = require 'grim' -EmitterMixin = require('emissary').Emitter {CompositeDisposable, Emitter} = require 'event-kit' {Point, Range} = TextBuffer = require 'text-buffer' LanguageMode = require './language-mode' @@ -3015,6 +3014,7 @@ if includeDeprecatedAPIs deprecate("Use TextEditor::isSoftWrapped instead") @displayBuffer.isSoftWrapped() + EmitterMixin = require('emissary').Emitter TextEditor::on = (eventName) -> switch eventName when 'title-changed' From 7b952e3f33d2a85c92ead87537800062af93df6d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 14:44:46 -0700 Subject: [PATCH 67/70] Remove unused emissary mixins --- src/language-mode.coffee | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/language-mode.coffee b/src/language-mode.coffee index 125b15ff6..54638965a 100644 --- a/src/language-mode.coffee +++ b/src/language-mode.coffee @@ -1,14 +1,10 @@ {Range} = require 'text-buffer' _ = require 'underscore-plus' {OnigRegExp} = require 'oniguruma' -{Emitter, Subscriber} = require 'emissary' ScopeDescriptor = require './scope-descriptor' module.exports = class LanguageMode - Emitter.includeInto(this) - Subscriber.includeInto(this) - # Sets up a `LanguageMode` for the given {TextEditor}. # # editor - The {TextEditor} to associate with @@ -16,7 +12,6 @@ class LanguageMode {@buffer} = @editor destroy: -> - @unsubscribe() toggleLineCommentForBufferRow: (row) -> @toggleLineCommentsForBufferRows(row, row) From 018fe0e8b8473bcc459e503742bdec193e7939ab Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 15:11:53 -0700 Subject: [PATCH 68/70] Only set atom.__workspaceView in deprecated mode --- src/atom.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/atom.coffee b/src/atom.coffee index f5e229962..dd86b382c 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -729,7 +729,10 @@ class Atom extends Model @workspace = Workspace.deserialize(@state.workspace) ? new Workspace workspaceElement = @views.getView(@workspace) - @__workspaceView = workspaceElement.__spacePenView + + if includeDeprecatedAPIs + @__workspaceView = workspaceElement.__spacePenView + @deserializeTimings.workspace = Date.now() - startTime @keymaps.defaultTarget = workspaceElement From 2fc132c97b51ee2f612cb5f55f1fc5879c7bd60c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 15:23:25 -0700 Subject: [PATCH 69/70] :racehorse: Use require to read/parse package.json This file is really large and should be read via require so it is cached --- src/package-manager.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 16142cda4..9d085e27f 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -276,9 +276,9 @@ class PackageManager getPackageDependencies: -> unless @packageDependencies? try - metadataPath = path.join(@resourcePath, 'package.json') - {@packageDependencies} = JSON.parse(fs.readFileSync(metadataPath)) ? {} - @packageDependencies ?= {} + @packageDependencies = require('../package.json')?.packageDependencies ? {} + catch error + @packageDependencies = {} @packageDependencies From 658629f45ec1101efbb6756cce132bc7217e4967 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 15:29:34 -0700 Subject: [PATCH 70/70] :art: --- src/package-manager.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 9d085e27f..386a65e68 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -276,9 +276,8 @@ class PackageManager getPackageDependencies: -> unless @packageDependencies? try - @packageDependencies = require('../package.json')?.packageDependencies ? {} - catch error - @packageDependencies = {} + @packageDependencies = require('../package.json')?.packageDependencies + @packageDependencies ?= {} @packageDependencies