From e7e754eb3068e86d1e19eec7c70dfc2d0d4ab51b Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Wed, 18 Mar 2015 17:40:49 +1100 Subject: [PATCH 01/31] :memo: document where to add the tests and how to run them --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32dccf299..6be3b8778 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ For more information on how to work with Atom's official packages, see [JavaScript](https://github.com/styleguide/javascript), and [CSS](https://github.com/styleguide/css) styleguides. * Include thoughtfully-worded, well-structured - [Jasmine](http://jasmine.github.io/) specs. + [Jasmine](http://jasmine.github.io/) specs in the `./spec` folder. Run them using `script/grunt run-specs` target with atom closed. * Document new code based on the [Documentation Styleguide](#documentation-styleguide) * End files with a newline. From cac361e6dfffe1a17209f68781b9b7bb05b055f0 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 18 Mar 2015 15:34:28 -0700 Subject: [PATCH 02/31] add packages for new spec Signed-off-by: Kevin Sawicki --- .../index.coffee | 4 ++++ .../package.json | 11 +++++++++++ .../index.coffee | 4 ++++ .../package.json | 12 ++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 spec/fixtures/packages/package-with-missing-consumed-services/index.coffee create mode 100644 spec/fixtures/packages/package-with-missing-consumed-services/package.json create mode 100644 spec/fixtures/packages/package-with-missing-provided-services/index.coffee create mode 100644 spec/fixtures/packages/package-with-missing-provided-services/package.json diff --git a/spec/fixtures/packages/package-with-missing-consumed-services/index.coffee b/spec/fixtures/packages/package-with-missing-consumed-services/index.coffee new file mode 100644 index 000000000..0f1fc41e0 --- /dev/null +++ b/spec/fixtures/packages/package-with-missing-consumed-services/index.coffee @@ -0,0 +1,4 @@ +module.exports = + activate: -> + + deactivate: -> diff --git a/spec/fixtures/packages/package-with-missing-consumed-services/package.json b/spec/fixtures/packages/package-with-missing-consumed-services/package.json new file mode 100644 index 000000000..d0e0ddfcb --- /dev/null +++ b/spec/fixtures/packages/package-with-missing-consumed-services/package.json @@ -0,0 +1,11 @@ +{ + "name": "package-with-missing-consumed-services", + + "consumedServices": { + "service-1": { + "versions": { + ">=0.1": "consumeMissingService" + } + } + } +} diff --git a/spec/fixtures/packages/package-with-missing-provided-services/index.coffee b/spec/fixtures/packages/package-with-missing-provided-services/index.coffee new file mode 100644 index 000000000..0f1fc41e0 --- /dev/null +++ b/spec/fixtures/packages/package-with-missing-provided-services/index.coffee @@ -0,0 +1,4 @@ +module.exports = + activate: -> + + deactivate: -> diff --git a/spec/fixtures/packages/package-with-missing-provided-services/package.json b/spec/fixtures/packages/package-with-missing-provided-services/package.json new file mode 100644 index 000000000..a090354a2 --- /dev/null +++ b/spec/fixtures/packages/package-with-missing-provided-services/package.json @@ -0,0 +1,12 @@ +{ + "name": "package-with-missing-provided-services", + + "providedServices": { + "service-1": { + "description": "The first service", + "versions": { + "0.2.9": "provideMissingService" + } + } + } +} From a787242e7a845c9f6d16a3a8f7fa5892007403de Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 18 Mar 2015 15:37:16 -0700 Subject: [PATCH 03/31] check that services method exists Signed-off-by: Kevin Sawicki --- src/package.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/package.coffee b/src/package.coffee index 4d244c50f..54dc75f2b 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -225,12 +225,14 @@ class Package for name, {versions} of @metadata.providedServices servicesByVersion = {} for version, methodName of versions - servicesByVersion[version] = @mainModule[methodName]() + if typeof @mainModule[methodName] is 'function' + servicesByVersion[version] = @mainModule[methodName]() @activationDisposables.add atom.packages.serviceHub.provide(name, servicesByVersion) for name, {versions} of @metadata.consumedServices for version, methodName of versions - @activationDisposables.add atom.packages.serviceHub.consume(name, version, @mainModule[methodName].bind(@mainModule)) + if typeof @mainModule[methodName] is 'function' + @activationDisposables.add atom.packages.serviceHub.consume(name, version, @mainModule[methodName].bind(@mainModule)) return loadKeymaps: -> From 2c46748307e765bd7796c092535048d5827bd4f2 Mon Sep 17 00:00:00 2001 From: Jessica Lord Date: Wed, 18 Mar 2015 15:38:13 -0700 Subject: [PATCH 04/31] add spec to check missing service methods are skipped Signed-off-by: Kevin Sawicki --- spec/package-manager-spec.coffee | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/package-manager-spec.coffee b/spec/package-manager-spec.coffee index 758d7468f..2789f36c3 100644 --- a/spec/package-manager-spec.coffee +++ b/spec/package-manager-spec.coffee @@ -547,6 +547,21 @@ describe "PackageManager", -> expect(consumerModule.consumeFirstServiceV4).not.toHaveBeenCalled() expect(consumerModule.consumeSecondService).not.toHaveBeenCalled() + it "ignores provided and consumed services that do not exist", -> + addErrorHandler = jasmine.createSpy() + atom.notifications.onDidAddNotification(addErrorHandler) + + waitsForPromise -> + atom.packages.activatePackage("package-with-missing-consumed-services") + + waitsForPromise -> + atom.packages.activatePackage("package-with-missing-provided-services") + + runs -> + expect(atom.packages.isPackageActive("package-with-missing-consumed-services")).toBe true + expect(atom.packages.isPackageActive("package-with-missing-provided-services")).toBe true + expect(addErrorHandler.callCount).toBe 0 + describe "::deactivatePackage(id)", -> afterEach -> atom.packages.unloadPackages() From 2aa566b7c6eaa81b5650e7e1e7ece6cc68a10eac Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Thu, 19 Mar 2015 10:56:55 +1100 Subject: [PATCH 05/31] :memo: document where to add the tests and how to run them --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6be3b8778..a5ebdd5f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ For more information on how to work with Atom's official packages, see [JavaScript](https://github.com/styleguide/javascript), and [CSS](https://github.com/styleguide/css) styleguides. * Include thoughtfully-worded, well-structured - [Jasmine](http://jasmine.github.io/) specs in the `./spec` folder. Run them using `script/grunt run-specs` target with atom closed. + [Jasmine](http://jasmine.github.io/) specs in the `./spec` folder. Run them using `apm test`. * Document new code based on the [Documentation Styleguide](#documentation-styleguide) * End files with a newline. From 56020b11b0e2d1d43c69df54b550995cfab5f2f7 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Mar 2015 11:36:55 +0100 Subject: [PATCH 06/31] :bug: Avoid soft-wrapping on indentation --- spec/display-buffer-spec.coffee | 18 ++++++++++++++++++ src/tokenized-line.coffee | 26 +++++++++++++++----------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/spec/display-buffer-spec.coffee b/spec/display-buffer-spec.coffee index 1703a24d1..95f22acca 100644 --- a/spec/display-buffer-spec.coffee +++ b/spec/display-buffer-spec.coffee @@ -115,6 +115,24 @@ describe "DisplayBuffer", -> expect(displayBuffer.tokenizedLineForScreenRow(3).text).toBe ' var pivot = items.shift(), current, left = [], ' expect(displayBuffer.tokenizedLineForScreenRow(4).text).toBe ' right = [];' + describe "when the only whitespace characters are at the beginning of the line", -> + beforeEach -> + displayBuffer.setEditorWidthInChars(10) + + it "wraps the line at the max length when indented with tabs", -> + buffer.setTextInRange([[0, 0], [1, 0]], '\t\tabcdefghijklmnopqrstuvwxyz') + + expect(displayBuffer.tokenizedLineForScreenRow(0).text).toBe ' abcdef' + expect(displayBuffer.tokenizedLineForScreenRow(1).text).toBe ' ghijkl' + expect(displayBuffer.tokenizedLineForScreenRow(2).text).toBe ' mnopqr' + + it "wraps the line at the max length when indented with spaces", -> + buffer.setTextInRange([[0, 0], [1, 0]], ' abcdefghijklmnopqrstuvwxyz') + + expect(displayBuffer.tokenizedLineForScreenRow(0).text).toBe ' abcdef' + expect(displayBuffer.tokenizedLineForScreenRow(1).text).toBe ' ghijkl' + expect(displayBuffer.tokenizedLineForScreenRow(2).text).toBe ' mnopqr' + describe "when there are hard tabs", -> beforeEach -> buffer.setText(buffer.getText().replace(new RegExp(' ', 'g'), '\t')) diff --git a/src/tokenized-line.coffee b/src/tokenized-line.coffee index 2a807d84a..513ad5b4b 100644 --- a/src/tokenized-line.coffee +++ b/src/tokenized-line.coffee @@ -106,7 +106,7 @@ class TokenizedLine return @text.length else # search backward for the start of the word on the boundary - for column in [maxColumn..0] when @isColumnOutsideSoftWrapIndentation(column) + for column in [maxColumn..0] when @isColumnOutsideIndentation(column) return column + 1 if /\s/.test(@text[column]) return maxColumn @@ -127,12 +127,13 @@ class TokenizedLine rightTokens = new Array(@tokens...) leftTokens = [] - leftTextLength = 0 - while leftTextLength < column - if leftTextLength + rightTokens[0].value.length > column - rightTokens[0..0] = rightTokens[0].splitAt(column - leftTextLength) + leftScreenColumn = 0 + + while leftScreenColumn < column + if leftScreenColumn + rightTokens[0].screenDelta > column + rightTokens[0..0] = rightTokens[0].splitAt(column - leftScreenColumn) nextToken = rightTokens.shift() - leftTextLength += nextToken.value.length + leftScreenColumn += nextToken.screenDelta leftTokens.push nextToken indentationTokens = @buildSoftWrapIndentationTokens(leftTokens[0], hangingIndent) @@ -160,6 +161,9 @@ class TokenizedLine isSoftWrapped: -> @lineEnding is null + isColumnOutsideIndentation: (column) -> + column >= @firstNonWhitespaceIndex and @isColumnOutsideSoftWrapIndentation(column) + isColumnOutsideSoftWrapIndentation: (column) -> return true if @softWrapIndentationTokens.length == 0 @@ -209,15 +213,15 @@ class TokenizedLine outputTokens markLeadingAndTrailingWhitespaceTokens: -> - firstNonWhitespaceIndex = @text.search(NonWhitespaceRegex) - if firstNonWhitespaceIndex > 0 and isPairedCharacter(@text, firstNonWhitespaceIndex - 1) - firstNonWhitespaceIndex-- + @firstNonWhitespaceIndex = @text.search(NonWhitespaceRegex) + if @firstNonWhitespaceIndex > 0 and isPairedCharacter(@text, @firstNonWhitespaceIndex - 1) + @firstNonWhitespaceIndex-- firstTrailingWhitespaceIndex = @text.search(TrailingWhitespaceRegex) @lineIsWhitespaceOnly = firstTrailingWhitespaceIndex is 0 index = 0 for token in @tokens - if index < firstNonWhitespaceIndex - token.firstNonWhitespaceIndex = Math.min(index + token.value.length, firstNonWhitespaceIndex - index) + if index < @firstNonWhitespaceIndex + token.firstNonWhitespaceIndex = Math.min(index + token.value.length, @firstNonWhitespaceIndex - index) # Only the *last* segment of a soft-wrapped line can have trailing whitespace if @lineEnding? and (index + token.value.length > firstTrailingWhitespaceIndex) token.firstTrailingWhitespaceIndex = Math.max(0, firstTrailingWhitespaceIndex - index) From 61cc9b97eabb8f3c7d7e0dd8503768884f076a5d Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Mar 2015 11:45:54 +0100 Subject: [PATCH 07/31] :green_heart: Fix failing spec --- spec/text-editor-component-spec.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index f5c9e7677..20ddcdcab 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -1937,14 +1937,14 @@ describe "TextEditorComponent", -> gutterNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenRowInGutter(11), metaKey: true)) nextAnimationFrame() gutterNode.dispatchEvent(buildMouseEvent('mouseup', clientCoordinatesForScreenRowInGutter(11), metaKey: true)) - expect(editor.getSelectedScreenRanges()).toEqual [[[7, 4], [7, 6]], [[10, 0], [20, 0]]] + expect(editor.getSelectedScreenRanges()).toEqual [[[7, 4], [7, 6]], [[10, 0], [19, 0]]] it "merges overlapping selections", -> gutterNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenRowInGutter(17), metaKey: true)) gutterNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenRowInGutter(9), metaKey: true)) nextAnimationFrame() gutterNode.dispatchEvent(buildMouseEvent('mouseup', clientCoordinatesForScreenRowInGutter(9), metaKey: true)) - expect(editor.getSelectedScreenRanges()).toEqual [[[5, 0], [20, 0]]] + expect(editor.getSelectedScreenRanges()).toEqual [[[5, 0], [19, 0]]] describe "when the gutter is shift-clicked and dragged", -> describe "when the shift-click is below the existing selection's tail", -> From 03b526a76b38984be939a9a87f6af3b09ae45761 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Mar 2015 11:48:10 +0100 Subject: [PATCH 08/31] :art: Use only @firstNonWhitespaceIndex --- src/tokenized-line.coffee | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/tokenized-line.coffee b/src/tokenized-line.coffee index 513ad5b4b..489714ae3 100644 --- a/src/tokenized-line.coffee +++ b/src/tokenized-line.coffee @@ -11,6 +11,7 @@ module.exports = class TokenizedLine endOfLineInvisibles: null lineIsWhitespaceOnly: false + firstNonWhitespaceIndex: 0 foldable: false constructor: ({tokens, @lineEnding, @ruleStack, @startBufferColumn, @fold, @tabLength, @indentLevel, @invisibles}) -> @@ -162,12 +163,7 @@ class TokenizedLine @lineEnding is null isColumnOutsideIndentation: (column) -> - column >= @firstNonWhitespaceIndex and @isColumnOutsideSoftWrapIndentation(column) - - isColumnOutsideSoftWrapIndentation: (column) -> - return true if @softWrapIndentationTokens.length == 0 - - column > @softWrapIndentationDelta + column >= @firstNonWhitespaceIndex isColumnInsideSoftWrapIndentation: (column) -> return false if @softWrapIndentationTokens.length == 0 From 0e0eeb34263fcb3d574614dc17701cec2eeba3b4 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 19 Mar 2015 12:23:10 +0100 Subject: [PATCH 09/31] :fire: Delete TokenizedLine#isColumnOutsideIndentation --- src/tokenized-line.coffee | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tokenized-line.coffee b/src/tokenized-line.coffee index 489714ae3..b62ab316f 100644 --- a/src/tokenized-line.coffee +++ b/src/tokenized-line.coffee @@ -97,6 +97,7 @@ class TokenizedLine # Returns a {Number} representing the `line` position where the wrap would take place. # Returns `null` if a wrap wouldn't occur. findWrapColumn: (maxColumn) -> + return unless maxColumn? return unless @text.length > maxColumn if /\s/.test(@text[maxColumn]) @@ -107,7 +108,7 @@ class TokenizedLine return @text.length else # search backward for the start of the word on the boundary - for column in [maxColumn..0] when @isColumnOutsideIndentation(column) + for column in [maxColumn..@firstNonWhitespaceIndex] return column + 1 if /\s/.test(@text[column]) return maxColumn @@ -162,9 +163,6 @@ class TokenizedLine isSoftWrapped: -> @lineEnding is null - isColumnOutsideIndentation: (column) -> - column >= @firstNonWhitespaceIndex - isColumnInsideSoftWrapIndentation: (column) -> return false if @softWrapIndentationTokens.length == 0 From 2863fddff307fcded2736e6edb1ff2b80d95a92d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 09:35:26 -0700 Subject: [PATCH 10/31] :arrow_up: language-ruby-on-rails@0.21 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd906dd53..c50afafb1 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "language-property-list": "0.8.0", "language-python": "0.32.0", "language-ruby": "0.49.0", - "language-ruby-on-rails": "0.20.0", + "language-ruby-on-rails": "0.21.0", "language-sass": "0.36.0", "language-shellscript": "0.13.0", "language-source": "0.9.0", From dccf88063bf9241d83250554a8427ceb4b437389 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 09:37:20 -0700 Subject: [PATCH 11/31] :arrow_up: bracket-matcher@0.73 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c50afafb1..801aac11c 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "autosave": "0.20.0", "background-tips": "0.23.0", "bookmarks": "0.35.0", - "bracket-matcher": "0.72.0", + "bracket-matcher": "0.73.0", "command-palette": "0.34.0", "deprecation-cop": "0.37.0", "dev-live-reload": "0.45.0", From 6345799cf3dba3706a8eebb258da6e867c85144c Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 19 Mar 2015 12:47:58 -0600 Subject: [PATCH 12/31] Revert "Don't soft-wrap on indentation" --- spec/display-buffer-spec.coffee | 18 ---------------- spec/text-editor-component-spec.coffee | 4 ++-- src/tokenized-line.coffee | 30 ++++++++++++++------------ 3 files changed, 18 insertions(+), 34 deletions(-) diff --git a/spec/display-buffer-spec.coffee b/spec/display-buffer-spec.coffee index 95f22acca..1703a24d1 100644 --- a/spec/display-buffer-spec.coffee +++ b/spec/display-buffer-spec.coffee @@ -115,24 +115,6 @@ describe "DisplayBuffer", -> expect(displayBuffer.tokenizedLineForScreenRow(3).text).toBe ' var pivot = items.shift(), current, left = [], ' expect(displayBuffer.tokenizedLineForScreenRow(4).text).toBe ' right = [];' - describe "when the only whitespace characters are at the beginning of the line", -> - beforeEach -> - displayBuffer.setEditorWidthInChars(10) - - it "wraps the line at the max length when indented with tabs", -> - buffer.setTextInRange([[0, 0], [1, 0]], '\t\tabcdefghijklmnopqrstuvwxyz') - - expect(displayBuffer.tokenizedLineForScreenRow(0).text).toBe ' abcdef' - expect(displayBuffer.tokenizedLineForScreenRow(1).text).toBe ' ghijkl' - expect(displayBuffer.tokenizedLineForScreenRow(2).text).toBe ' mnopqr' - - it "wraps the line at the max length when indented with spaces", -> - buffer.setTextInRange([[0, 0], [1, 0]], ' abcdefghijklmnopqrstuvwxyz') - - expect(displayBuffer.tokenizedLineForScreenRow(0).text).toBe ' abcdef' - expect(displayBuffer.tokenizedLineForScreenRow(1).text).toBe ' ghijkl' - expect(displayBuffer.tokenizedLineForScreenRow(2).text).toBe ' mnopqr' - describe "when there are hard tabs", -> beforeEach -> buffer.setText(buffer.getText().replace(new RegExp(' ', 'g'), '\t')) diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index 20ddcdcab..f5c9e7677 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -1937,14 +1937,14 @@ describe "TextEditorComponent", -> gutterNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenRowInGutter(11), metaKey: true)) nextAnimationFrame() gutterNode.dispatchEvent(buildMouseEvent('mouseup', clientCoordinatesForScreenRowInGutter(11), metaKey: true)) - expect(editor.getSelectedScreenRanges()).toEqual [[[7, 4], [7, 6]], [[10, 0], [19, 0]]] + expect(editor.getSelectedScreenRanges()).toEqual [[[7, 4], [7, 6]], [[10, 0], [20, 0]]] it "merges overlapping selections", -> gutterNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenRowInGutter(17), metaKey: true)) gutterNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenRowInGutter(9), metaKey: true)) nextAnimationFrame() gutterNode.dispatchEvent(buildMouseEvent('mouseup', clientCoordinatesForScreenRowInGutter(9), metaKey: true)) - expect(editor.getSelectedScreenRanges()).toEqual [[[5, 0], [19, 0]]] + expect(editor.getSelectedScreenRanges()).toEqual [[[5, 0], [20, 0]]] describe "when the gutter is shift-clicked and dragged", -> describe "when the shift-click is below the existing selection's tail", -> diff --git a/src/tokenized-line.coffee b/src/tokenized-line.coffee index b62ab316f..2a807d84a 100644 --- a/src/tokenized-line.coffee +++ b/src/tokenized-line.coffee @@ -11,7 +11,6 @@ module.exports = class TokenizedLine endOfLineInvisibles: null lineIsWhitespaceOnly: false - firstNonWhitespaceIndex: 0 foldable: false constructor: ({tokens, @lineEnding, @ruleStack, @startBufferColumn, @fold, @tabLength, @indentLevel, @invisibles}) -> @@ -97,7 +96,6 @@ class TokenizedLine # Returns a {Number} representing the `line` position where the wrap would take place. # Returns `null` if a wrap wouldn't occur. findWrapColumn: (maxColumn) -> - return unless maxColumn? return unless @text.length > maxColumn if /\s/.test(@text[maxColumn]) @@ -108,7 +106,7 @@ class TokenizedLine return @text.length else # search backward for the start of the word on the boundary - for column in [maxColumn..@firstNonWhitespaceIndex] + for column in [maxColumn..0] when @isColumnOutsideSoftWrapIndentation(column) return column + 1 if /\s/.test(@text[column]) return maxColumn @@ -129,13 +127,12 @@ class TokenizedLine rightTokens = new Array(@tokens...) leftTokens = [] - leftScreenColumn = 0 - - while leftScreenColumn < column - if leftScreenColumn + rightTokens[0].screenDelta > column - rightTokens[0..0] = rightTokens[0].splitAt(column - leftScreenColumn) + leftTextLength = 0 + while leftTextLength < column + if leftTextLength + rightTokens[0].value.length > column + rightTokens[0..0] = rightTokens[0].splitAt(column - leftTextLength) nextToken = rightTokens.shift() - leftScreenColumn += nextToken.screenDelta + leftTextLength += nextToken.value.length leftTokens.push nextToken indentationTokens = @buildSoftWrapIndentationTokens(leftTokens[0], hangingIndent) @@ -163,6 +160,11 @@ class TokenizedLine isSoftWrapped: -> @lineEnding is null + isColumnOutsideSoftWrapIndentation: (column) -> + return true if @softWrapIndentationTokens.length == 0 + + column > @softWrapIndentationDelta + isColumnInsideSoftWrapIndentation: (column) -> return false if @softWrapIndentationTokens.length == 0 @@ -207,15 +209,15 @@ class TokenizedLine outputTokens markLeadingAndTrailingWhitespaceTokens: -> - @firstNonWhitespaceIndex = @text.search(NonWhitespaceRegex) - if @firstNonWhitespaceIndex > 0 and isPairedCharacter(@text, @firstNonWhitespaceIndex - 1) - @firstNonWhitespaceIndex-- + firstNonWhitespaceIndex = @text.search(NonWhitespaceRegex) + if firstNonWhitespaceIndex > 0 and isPairedCharacter(@text, firstNonWhitespaceIndex - 1) + firstNonWhitespaceIndex-- firstTrailingWhitespaceIndex = @text.search(TrailingWhitespaceRegex) @lineIsWhitespaceOnly = firstTrailingWhitespaceIndex is 0 index = 0 for token in @tokens - if index < @firstNonWhitespaceIndex - token.firstNonWhitespaceIndex = Math.min(index + token.value.length, @firstNonWhitespaceIndex - index) + if index < firstNonWhitespaceIndex + token.firstNonWhitespaceIndex = Math.min(index + token.value.length, firstNonWhitespaceIndex - index) # Only the *last* segment of a soft-wrapped line can have trailing whitespace if @lineEnding? and (index + token.value.length > firstTrailingWhitespaceIndex) token.firstTrailingWhitespaceIndex = Math.max(0, firstTrailingWhitespaceIndex - index) From b4f911f6d39d263adb9a9f966f8399b5972db265 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 18 Mar 2015 10:28:59 -0700 Subject: [PATCH 13/31] Add task to log loop returns --- build/tasks/output-for-loop-returns.coffee | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 build/tasks/output-for-loop-returns.coffee diff --git a/build/tasks/output-for-loop-returns.coffee b/build/tasks/output-for-loop-returns.coffee new file mode 100644 index 000000000..47523aa45 --- /dev/null +++ b/build/tasks/output-for-loop-returns.coffee @@ -0,0 +1,22 @@ +path = require 'path' + +module.exports = (grunt) -> + grunt.registerTask 'output-for-loop-returns', 'Log methods that end with a for loop', -> + appDir = grunt.config.get('atom.appDir') + + jsPaths = [] + grunt.file.recurse path.join(appDir, 'src'), (absolutePath, rootPath, relativePath, fileName) -> + jsPaths.push(absolutePath) if path.extname(fileName) is '.js' + + jsPaths.forEach (jsPath) -> + js = grunt.file.read(jsPath) + method = null + for line, index in js.split('\n') + [match, className, methodName] = /^\s*([a-zA-Z]+)\.prototype\.([a-zA-Z]+)\s*=\s*function\(/.exec(line) ? [] + if className and methodName + method = "#{className}::#{methodName}" + else + [match, ctorName] = /^\s*function\s+([a-zA-Z]+)\(/.exec(line) ? [] + + if /^\s*return\s+_results;\s*$/.test(line) + console.log(method ? "#{path.basename(jsPath)}:#{index}") From f728bc7aec2b9773c8a23e4f23e56f09b12f2bbb Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 18 Mar 2015 14:54:30 -0700 Subject: [PATCH 14/31] Add explicit returns to browser process classes --- src/browser/application-menu.coffee | 5 +++-- src/browser/atom-application.coffee | 2 ++ src/browser/auto-update-manager.coffee | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/browser/application-menu.coffee b/src/browser/application-menu.coffee index 5218ff304..4544a963d 100644 --- a/src/browser/application-menu.coffee +++ b/src/browser/application-menu.coffee @@ -82,7 +82,8 @@ class ApplicationMenu # window specific items. enableWindowSpecificItems: (enable) -> for item in @flattenMenuItems(@menu) - item.enabled = enable if item.metadata?['windowSpecific'] + item.enabled = enable if item.metadata?.windowSpecific + return # Replaces VERSION with the current version. substituteVersion: (template) -> @@ -145,7 +146,7 @@ class ApplicationMenu if item.command item.accelerator = @acceleratorForCommand(item.command, keystrokesByCommand) item.click = -> global.atomApplication.sendCommand(item.command) - item.metadata['windowSpecific'] = true unless /^application:/.test(item.command) + item.metadata.windowSpecific = true unless /^application:/.test(item.command) @translateTemplate(item.submenu, keystrokesByCommand) if item.submenu template diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index 8fa888730..d79b2bf76 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -388,11 +388,13 @@ class AtomApplication # Kill all processes associated with opened windows. killAllProcesses: -> @killProcess(pid) for pid of @pidsToOpenWindows + return # Kill process associated with the given opened window. killProcessForWindow: (openedWindow) -> for pid, trackedWindow of @pidsToOpenWindows @killProcess(pid) if trackedWindow is openedWindow + return # Kill the process with the given pid. killProcess: (pid) -> diff --git a/src/browser/auto-update-manager.coffee b/src/browser/auto-update-manager.coffee index a0c1f2da8..3ee0fce3d 100644 --- a/src/browser/auto-update-manager.coffee +++ b/src/browser/auto-update-manager.coffee @@ -65,6 +65,7 @@ class AutoUpdateManager return unless @releaseVersion? for atomWindow in windows atomWindow.sendMessage('update-available', {@releaseVersion}) + return setState: (state) -> return if @state is state From 6e464ac35c6e35cd6c2f0283fa74a2c66d325872 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 18 Mar 2015 15:18:55 -0700 Subject: [PATCH 15/31] Catch non-protype functions --- build/tasks/output-for-loop-returns.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/tasks/output-for-loop-returns.coffee b/build/tasks/output-for-loop-returns.coffee index 47523aa45..f9b036120 100644 --- a/build/tasks/output-for-loop-returns.coffee +++ b/build/tasks/output-for-loop-returns.coffee @@ -12,7 +12,7 @@ module.exports = (grunt) -> js = grunt.file.read(jsPath) method = null for line, index in js.split('\n') - [match, className, methodName] = /^\s*([a-zA-Z]+)\.prototype\.([a-zA-Z]+)\s*=\s*function\(/.exec(line) ? [] + [match, className, methodName] = /^\s*([a-zA-Z]+)\.(?:prototype\.)?([a-zA-Z]+)\s*=\s*function\(/.exec(line) ? [] if className and methodName method = "#{className}::#{methodName}" else From 590a4b0fd5cccef210e236991ddd4a3a3ee521b9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 18 Mar 2015 15:19:19 -0700 Subject: [PATCH 16/31] Add explicit return after for loop --- src/atom.coffee | 1 + src/command-registry.coffee | 2 ++ src/config.coffee | 3 +++ src/context-menu-manager.coffee | 1 + src/cursors-component.coffee | 2 ++ src/custom-event-mixin.coffee | 2 ++ src/deserializer-manager.coffee | 2 ++ src/display-buffer.coffee | 4 ++++ src/gutter-component.coffee | 2 ++ src/highlights-component.coffee | 4 ++++ src/language-mode.coffee | 4 ++++ src/lines-component.coffee | 3 +++ src/marker.coffee | 1 + src/package-manager.coffee | 2 ++ src/package.coffee | 4 ++++ src/pane-container.coffee | 2 ++ src/pane.coffee | 3 +++ src/project.coffee | 1 + src/row-map.coffee | 1 + src/selection.coffee | 7 +++++++ src/style-manager.coffee | 2 ++ src/styles-element.coffee | 1 + 22 files changed, 54 insertions(+) diff --git a/src/atom.coffee b/src/atom.coffee index e03502dee..188d0b3a6 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -825,6 +825,7 @@ class Atom extends Model delete window[key] else window[key] = value + return onUpdateAvailable: (callback) -> @emitter.on 'update-available', callback diff --git a/src/command-registry.coffee b/src/command-registry.coffee index ead4415d2..479d972fa 100644 --- a/src/command-registry.coffee +++ b/src/command-registry.coffee @@ -50,6 +50,7 @@ class CommandRegistry destroy: -> for commandName of @registeredCommands window.removeEventListener(commandName, @handleCommandEvent, true) + return # Public: Add one or more command listeners associated with a selector. # @@ -187,6 +188,7 @@ class CommandRegistry @selectorBasedListenersByCommandName = {} for commandName, listeners of snapshot @selectorBasedListenersByCommandName[commandName] = listeners.slice() + return handleCommandEvent: (originalEvent) => propagationStopped = false diff --git a/src/config.coffee b/src/config.coffee index 331e89af9..4901f21dc 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -301,6 +301,7 @@ class Config for typeName, functions of filters for name, enforcerFunction of functions @addSchemaEnforcer(typeName, enforcerFunction) + return @executeSchemaEnforcers: (keyPath, value, schema) -> error = null @@ -898,6 +899,7 @@ class Config @transact => @settings = {} @set(key, value, save: false) for key, value of newSettings + return getRawValue: (keyPath, options) -> unless options?.excludeSources?.indexOf(@getUserConfigPath()) >= 0 @@ -958,6 +960,7 @@ class Config @setRawDefault(keyPath, defaults) catch e console.warn("'#{keyPath}' could not set the default. Attempted default: #{JSON.stringify(defaults)}; Schema: #{JSON.stringify(@getSchema(keyPath))}") + return deepClone: (object) -> if object instanceof Color diff --git a/src/context-menu-manager.coffee b/src/context-menu-manager.coffee index 3f281afb1..ed91f5e6c 100644 --- a/src/context-menu-manager.coffee +++ b/src/context-menu-manager.coffee @@ -132,6 +132,7 @@ class ContextMenuManager new Disposable => for itemSet in addedItemSets @itemSets.splice(@itemSets.indexOf(itemSet), 1) + return templateForElement: (target) -> @templateForEvent({target}) diff --git a/src/cursors-component.coffee b/src/cursors-component.coffee index f4f5d749f..bd530ce2b 100644 --- a/src/cursors-component.coffee +++ b/src/cursors-component.coffee @@ -35,6 +35,8 @@ class CursorsComponent @domNode.appendChild(cursorNode) @updateCursorNode(id, cursorState) + return + updateCursorNode: (id, newCursorState) -> cursorNode = @cursorNodesById[id] oldCursorState = (@oldState.cursors[id] ?= {}) diff --git a/src/custom-event-mixin.coffee b/src/custom-event-mixin.coffee index 1a3bb4d88..12785c89c 100644 --- a/src/custom-event-mixin.coffee +++ b/src/custom-event-mixin.coffee @@ -7,9 +7,11 @@ CustomEventMixin = for name, listeners in @customEventListeners for listener in listeners @getDOMNode().removeEventListener(name, listener) + return addCustomEventListeners: (customEventListeners) -> for name, listener of customEventListeners @customEventListeners[name] ?= [] @customEventListeners[name].push(listener) @getDOMNode().addEventListener(name, listener) + return diff --git a/src/deserializer-manager.coffee b/src/deserializer-manager.coffee index 50becb31a..40c5ea7f3 100644 --- a/src/deserializer-manager.coffee +++ b/src/deserializer-manager.coffee @@ -35,10 +35,12 @@ class DeserializerManager @deserializers[deserializer.name] = deserializer for deserializer in deserializers new Disposable => delete @deserializers[deserializer.name] for deserializer in deserializers + return remove: (classes...) -> Grim.deprecate("Call .dispose() on the Disposable return from ::add instead") delete @deserializers[name] for {name} in classes + return # Public: Deserialize the state and params. # diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index 8e8bd8dcd..4ab65d0f7 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -538,6 +538,7 @@ class DisplayBuffer extends Model # bufferRow - The buffer row {Number} to check against unfoldBufferRow: (bufferRow) -> fold.destroy() for fold in @foldsContainingBufferRow(bufferRow) + return # Given a buffer row, this returns the largest fold that starts there. # @@ -1082,6 +1083,7 @@ class DisplayBuffer extends Model pauseMarkerChangeEvents: -> marker.pauseChangeEvents() for marker in @getMarkers() + return resumeMarkerChangeEvents: -> marker.resumeChangeEvents() for marker in @getMarkers() @@ -1091,6 +1093,7 @@ class DisplayBuffer extends Model refreshMarkerScreenPositions: -> for marker in @getMarkers() marker.notifyObservers(textChanged: false) + return destroyed: -> marker.unsubscribe() for id, marker of @markers @@ -1102,6 +1105,7 @@ class DisplayBuffer extends Model for row in [start..end] line = @tokenizedLineForScreenRow(row).text console.log row, @bufferRowForScreenRow(row), line, line.length + return getRootScopeDescriptor: -> @tokenizedBuffer.rootScopeDescriptor diff --git a/src/gutter-component.coffee b/src/gutter-component.coffee index 6eb11ff1f..072ac99a0 100644 --- a/src/gutter-component.coffee +++ b/src/gutter-component.coffee @@ -84,6 +84,8 @@ class GutterComponent delete @lineNumberNodesById[id] delete @oldState.lineNumbers[id] + return + buildLineNumberHTML: (lineNumberState) -> {screenRow, bufferRow, softWrapped, top, decorationClasses} = lineNumberState if screenRow? diff --git a/src/highlights-component.coffee b/src/highlights-component.coffee index 3bd5197fe..e2c629cb9 100644 --- a/src/highlights-component.coffee +++ b/src/highlights-component.coffee @@ -39,6 +39,8 @@ class HighlightsComponent @domNode.appendChild(highlightNode) @updateHighlightNode(id, highlightState) + return + updateHighlightNode: (id, newHighlightState) -> highlightNode = @highlightNodesById[id] oldHighlightState = (@oldState[id] ?= {regions: [], flashCount: 0}) @@ -92,6 +94,8 @@ class HighlightsComponent else regionNode.style[property] = '' + return + flashHighlightNodeIfRequested: (id, newHighlightState) -> oldHighlightState = @oldState[id] return unless newHighlightState.flashCount > oldHighlightState.flashCount diff --git a/src/language-mode.coffee b/src/language-mode.coffee index b7a52280b..125b15ff6 100644 --- a/src/language-mode.coffee +++ b/src/language-mode.coffee @@ -104,11 +104,13 @@ class LanguageMode [startRow, endRow] = @rowRangeForFoldAtBufferRow(currentRow) ? [] continue unless startRow? @editor.createFold(startRow, endRow) + return # Unfolds all the foldable lines in the buffer. unfoldAll: -> for row in [@buffer.getLastRow()..0] fold.destroy() for fold in @editor.displayBuffer.foldsStartingAtBufferRow(row) + return # Fold all comment and code blocks at a given indentLevel # @@ -122,6 +124,7 @@ class LanguageMode # assumption: startRow will always be the min indent level for the entire range if @editor.indentationForBufferRow(startRow) == indentLevel @editor.createFold(startRow, endRow) + return # Given a buffer row, creates a fold at it. # @@ -276,6 +279,7 @@ class LanguageMode # endRow - The row {Number} to end at autoIndentBufferRows: (startRow, endRow) -> @autoIndentBufferRow(row) for row in [startRow..endRow] + return # Given a buffer row, this indents it. # diff --git a/src/lines-component.coffee b/src/lines-component.coffee index fa4ab23b0..8389a1ae9 100644 --- a/src/lines-component.coffee +++ b/src/lines-component.coffee @@ -89,6 +89,7 @@ class LinesComponent removeLineNodes: -> @removeLineNode(id) for id of @oldState.lines + return removeLineNode: (id) -> @lineNodesByLineId[id].remove() @@ -126,6 +127,8 @@ class LinesComponent @lineNodesByLineId[id] = lineNode @domNode.appendChild(lineNode) + return + buildLineHTML: (id) -> {scrollWidth} = @newState {screenRow, tokens, text, top, lineEnding, fold, isSoftWrapped, indentLevel, decorationClasses} = @newState.lines[id] diff --git a/src/marker.coffee b/src/marker.coffee index 2224ca1c7..22460c1f8 100644 --- a/src/marker.coffee +++ b/src/marker.coffee @@ -396,6 +396,7 @@ class Marker for event in deferredChangeEvents @emit 'changed', event @emitter.emit 'did-change', event + return getPixelRange: -> @displayBuffer.pixelRangeForScreenRange(@getScreenRange(), false) diff --git a/src/package-manager.coffee b/src/package-manager.coffee index 9f53d45e2..444497c5b 100644 --- a/src/package-manager.coffee +++ b/src/package-manager.coffee @@ -394,6 +394,7 @@ class PackageManager for pack in packages promise = @activatePackage(pack.name) promises.push(promise) unless pack.hasActivationCommands() + return @observeDisabledPackages() promises @@ -413,6 +414,7 @@ class PackageManager deactivatePackages: -> atom.config.transact => @deactivatePackage(pack.name) for pack in @getLoadedPackages() + return @unobserveDisabledPackages() # Deactivate the package with the given name diff --git a/src/package.coffee b/src/package.coffee index 4d244c50f..44516261a 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -238,12 +238,14 @@ class Package @keymaps = (["#{atom.packages.resourcePath}#{path.sep}#{keymapPath}", keymapObject] for keymapPath, keymapObject of packagesCache[@name].keymaps) else @keymaps = @getKeymapPaths().map (keymapPath) -> [keymapPath, CSON.readFileSync(keymapPath) ? {}] + return loadMenus: -> if @bundledPackage and packagesCache[@name]? @menus = (["#{atom.packages.resourcePath}#{path.sep}#{menuPath}", menuObject] for menuPath, menuObject of packagesCache[@name].menus) else @menus = @getMenuPaths().map (menuPath) -> [menuPath, CSON.readFileSync(menuPath) ? {}] + return getKeymapPaths: -> keymapsDirPath = path.join(@path, 'keymaps') @@ -447,6 +449,7 @@ class Package @activateNow() break currentTarget = currentTarget.parentElement + return getActivationCommands: -> return @activationCommands if @activationCommands? @@ -505,6 +508,7 @@ class Package for modulePath in fs.listSync(nodeModulesPath) nativeModulePaths.push(modulePath) if @isNativeModule(modulePath) traversePath(path.join(modulePath, 'node_modules')) + return traversePath(path.join(@path, 'node_modules')) nativeModulePaths diff --git a/src/pane-container.coffee b/src/pane-container.coffee index 14fa25a44..61ff9f207 100644 --- a/src/pane-container.coffee +++ b/src/pane-container.coffee @@ -151,6 +151,7 @@ class PaneContainer extends Model saveAll: -> pane.saveItems() for pane in @getPanes() + return confirmClose: (options) -> allSaved = true @@ -186,6 +187,7 @@ class PaneContainer extends Model destroyEmptyPanes: -> pane.destroy() for pane in @getPanes() when pane.items.length is 0 + return willDestroyPaneItem: (event) -> @emitter.emit 'will-destroy-pane-item', event diff --git a/src/pane.coffee b/src/pane.coffee index 0f19c40bf..a1239acb5 100644 --- a/src/pane.coffee +++ b/src/pane.coffee @@ -440,10 +440,12 @@ class Pane extends Model # Public: Destroy all items. destroyItems: -> @destroyItem(item) for item in @getItems() + return # Public: Destroy all items except for the active item. destroyInactiveItems: -> @destroyItem(item) for item in @getItems() when item isnt @activeItem + return promptToSaveItem: (item, options={}) -> return true unless item.shouldPromptToSave?(options) @@ -518,6 +520,7 @@ class Pane extends Model # Public: Save all items. saveItems: -> @saveItem(item) for item in @getItems() + return # Public: Return the first item that matches the given URI or undefined if # none exists. diff --git a/src/project.coffee b/src/project.coffee index a54d5edd1..299ba920b 100644 --- a/src/project.coffee +++ b/src/project.coffee @@ -83,6 +83,7 @@ class Project extends Model destroyUnretainedBuffers: -> buffer.destroy() for buffer in @getBuffers() when not buffer.isRetained() + return ### Section: Serialization diff --git a/src/row-map.coffee b/src/row-map.coffee index fd5dfb2ea..5510c1421 100644 --- a/src/row-map.coffee +++ b/src/row-map.coffee @@ -112,6 +112,7 @@ class RowMap @regions.splice index - 1, 2, bufferRows: leftRegion.bufferRows + rightRegion.bufferRows screenRows: leftRegion.screenRows + rightRegion.screenRows + return # Public: Returns an array of strings describing the map's regions. inspect: -> diff --git a/src/selection.coffee b/src/selection.coffee index 5b0fdae38..375498c41 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -538,6 +538,7 @@ class Selection extends Model for row in [start..end] if matchLength = buffer.lineForRow(row).match(leadingTabRegex)?[0].length buffer.delete [[row, 0], [row, matchLength]] + return # Public: Sets the indentation level of all selected rows to values suggested # by the relevant grammars. @@ -620,6 +621,7 @@ class Selection extends Model currentIndentLevel = @editor.indentLevelForLine(lines[i]) indentLevel = Math.max(0, currentIndentLevel + indentAdjustment) lines[i] = line.replace(/^[\t ]+/, @editor.buildIndentString(indentLevel)) + return # Indent the current line(s). # @@ -651,6 +653,7 @@ class Selection extends Model [start, end] = @getBufferRowRange() for row in [start..end] @editor.buffer.insert([row, 0], @editor.getTabText()) unless @editor.buffer.lineLengthForRow(row) == 0 + return ### Section: Managing multiple selections @@ -674,6 +677,8 @@ class Selection extends Model @editor.addSelectionForScreenRange(clippedRange, goalScreenRange: range) break + return + # Public: Moves the selection up one row. addSelectionAbove: -> range = (@getGoalScreenRange() ? @getScreenRange()).copy() @@ -692,6 +697,8 @@ class Selection extends Model @editor.addSelectionForScreenRange(clippedRange, goalScreenRange: range) break + return + # Public: Combines the given selection into this selection and then destroys # the given selection. # diff --git a/src/style-manager.coffee b/src/style-manager.coffee index c891223b9..cfe86b3fe 100644 --- a/src/style-manager.coffee +++ b/src/style-manager.coffee @@ -152,6 +152,8 @@ class StyleManager for styleElement in styleElementsToRestore @addStyleElement(styleElement) unless styleElement in existingStyleElements + return + ### Section: Paths ### diff --git a/src/styles-element.coffee b/src/styles-element.coffee index d333a2e45..fc3b888cf 100644 --- a/src/styles-element.coffee +++ b/src/styles-element.coffee @@ -46,6 +46,7 @@ class StylesElement extends HTMLElement @styleElementRemoved(child) for child in Array::slice.call(@children) @context = @getAttribute('context') @styleElementAdded(styleElement) for styleElement in atom.styles.getStyleElements() + return styleElementAdded: (styleElement) -> return unless @styleElementMatchesContext(styleElement) From d9a5aff919087133f8f3cd223cf4ec4b391be32e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 18 Mar 2015 15:34:50 -0700 Subject: [PATCH 17/31] Add explicit return after for loop --- src/text-editor-presenter.coffee | 11 +++++++++++ src/text-editor.coffee | 20 +++++++++++++++++--- src/tokenized-buffer.coffee | 2 ++ src/tokenized-line.coffee | 3 +++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index ebcc5a5ca..babd7725b 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -124,6 +124,7 @@ class TextEditorPresenter @disposables.add @model.onDidChangeScrollLeft(@setScrollLeft.bind(this)) @observeDecoration(decoration) for decoration in @model.getDecorations() @observeCursor(cursor) for cursor in @model.getCursors() + return observeConfig: -> configParams = {scope: @model.getRootScopeDescriptor()} @@ -273,6 +274,7 @@ class TextEditorPresenter for id, line of @state.content.lines unless visibleLineIds.hasOwnProperty(id) delete @state.content.lines[id] + return updateLineState: (row, line) -> lineState = @state.content.lines[line.id] @@ -296,6 +298,7 @@ class TextEditorPresenter updateCursorsState: -> @batch "shouldUpdateCursorsState", -> @state.content.cursors = {} @updateCursorState(cursor) for cursor in @model.cursors # using property directly to avoid allocation + return updateCursorState: (cursor, destroyOnly = false) -> delete @state.content.cursors[cursor.id] @@ -331,6 +334,8 @@ class TextEditorPresenter for id of @state.content.overlays delete @state.content.overlays[id] unless visibleDecorationIds[id] + return + updateGutterState: -> @batch "shouldUpdateGutterState", -> @state.gutter.visible = not @model.isMini() and (@model.isGutterVisible() ? true) and @showLineNumbers @state.gutter.maxLineNumberDigits = @model.getLineCount().toString().length @@ -382,6 +387,8 @@ class TextEditorPresenter for id of @state.gutter.lineNumbers delete @state.gutter.lineNumbers[id] unless visibleLineNumberIds[id] + return + updateStartRow: -> return unless @scrollTop? and @lineHeight? @@ -873,11 +880,13 @@ class TextEditorPresenter unless visibleHighlights[id] delete @state.content.highlights[id] + return removeFromLineDecorationCaches: (decoration, range) -> for row in [range.start.row..range.end.row] by 1 delete @lineDecorationsByScreenRow[row]?[decoration.id] delete @lineNumberDecorationsByScreenRow[row]?[decoration.id] + return addToLineDecorationCaches: (decoration, range) -> marker = decoration.getMarker() @@ -903,6 +912,8 @@ class TextEditorPresenter @lineNumberDecorationsByScreenRow[row] ?= {} @lineNumberDecorationsByScreenRow[row][decoration.id] = decoration + return + updateHighlightState: (decoration) -> return unless @startRow? and @endRow? and @lineHeight? and @hasPixelPositionRequirements() diff --git a/src/text-editor.coffee b/src/text-editor.coffee index f731810ae..d29013280 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -842,7 +842,9 @@ class TextEditor extends Model # {Number} index of that selection. mutateSelectedText: (fn) -> @mergeIntersectingSelections => - @transact => fn(selection, index) for selection, index in @getSelections() + @transact => + fn(selection, index) for selection, index in @getSelections() + return # Move lines intersection the most recent selection up by one row in screen # coordinates. @@ -978,6 +980,7 @@ class TextEditor extends Model selection.setBufferRange(selectedBufferRange.translate([delta, 0])) for [foldStartRow, foldEndRow] in foldedRowRanges @createFold(foldStartRow + delta, foldEndRow + delta) + return # Deprecated: Use {::duplicateLines} instead. duplicateLine: -> @@ -1013,6 +1016,7 @@ class TextEditor extends Model while ++row < end.row @addSelectionForBufferRange([[row, 0], [row, Infinity]]) @addSelectionForBufferRange([[end.row, 0], [end.row, end.column]]) unless end.column is 0 + return # Extended: For each selection, transpose the selected text. # @@ -1779,7 +1783,7 @@ class TextEditor extends Model # Extended: Get an Array of all {Cursor}s. getCursors: -> - cursor for cursor in @cursors + @cursors.slice() # Extended: Get all {Cursors}s, ordered by their position in the buffer # instead of the order in which they were added. @@ -1822,6 +1826,7 @@ class TextEditor extends Model cursor.destroy() else positions[position] = true + return preserveCursorPositionOnBufferReload: -> cursorPosition = null @@ -1886,6 +1891,7 @@ class TextEditor extends Model selections[i].setBufferRange(bufferRange, options) else @addSelectionForBufferRange(bufferRange, options) + return # Essential: Get the {Range} of the most recently added selection in screen # coordinates. @@ -1932,6 +1938,7 @@ class TextEditor extends Model selections[i].setScreenRange(screenRange, options) else @addSelectionForScreenRange(screenRange, options) + return # Essential: Add a selection for the given range in buffer coordinates. # @@ -2159,7 +2166,7 @@ class TextEditor extends Model # # Returns: An {Array} of {Selection}s. getSelections: -> - selection for selection in @selections + @selections.slice() # Extended: Get all {Selection}s, ordered by their position in the buffer # instead of the order in which they were added. @@ -2206,15 +2213,18 @@ class TextEditor extends Model expandSelectionsForward: (fn) -> @mergeIntersectingSelections => fn(selection) for selection in @getSelections() + return # Calls the given function with each selection, then merges selections in the # reversed orientation expandSelectionsBackward: (fn) -> @mergeIntersectingSelections reversed: true, => fn(selection) for selection in @getSelections() + return finalizeSelections: -> selection.finalize() for selection in @getSelections() + return selectionsForScreenRows: (startRow, endRow) -> @getSelections().filter (selection) -> selection.intersectsScreenRowRange(startRow, endRow) @@ -2620,6 +2630,7 @@ class TextEditor extends Model else selection.copy(maintainClipboard, false) maintainClipboard = true + return # Essential: For each selection, cut the selected text. cutSelectedText: -> @@ -2714,6 +2725,7 @@ class TextEditor extends Model # Extended: For each selection, fold the rows it intersects. foldSelectedLines: -> selection.fold() for selection in @getSelections() + return # Extended: Fold all foldable lines. foldAll: -> @@ -2796,6 +2808,8 @@ class TextEditor extends Model for row in [bufferRange.end.row..bufferRange.start.row] fold.destroy() for fold in @displayBuffer.foldsStartingAtBufferRow(row) + return + # Remove any {Fold}s found that contain the given buffer range. destroyFoldsContainingBufferRange: (bufferRange) -> @unfoldBufferRow(bufferRange.start.row) diff --git a/src/tokenized-buffer.coffee b/src/tokenized-buffer.coffee index b8a9bdab7..cf7d15c28 100644 --- a/src/tokenized-buffer.coffee +++ b/src/tokenized-buffer.coffee @@ -197,6 +197,7 @@ class TokenizedBuffer extends Model validateRow: (row) -> @invalidRows.shift() while @invalidRows[0] <= row + return invalidateRow: (row) -> @invalidRows.push(row) @@ -468,3 +469,4 @@ class TokenizedBuffer extends Model for row in [start..end] line = @tokenizedLineForRow(row).text console.log row, line, line.length + return diff --git a/src/tokenized-line.coffee b/src/tokenized-line.coffee index 2a807d84a..f67d754c8 100644 --- a/src/tokenized-line.coffee +++ b/src/tokenized-line.coffee @@ -222,6 +222,7 @@ class TokenizedLine if @lineEnding? and (index + token.value.length > firstTrailingWhitespaceIndex) token.firstTrailingWhitespaceIndex = Math.max(0, firstTrailingWhitespaceIndex - index) index += token.value.length + return substituteInvisibleCharacters: -> invisibles = @invisibles @@ -309,6 +310,8 @@ class TokenizedLine for j in [i...desiredScopeDescriptor.length] scopeStack.push(new Scope(desiredScopeDescriptor[j])) + return + class Scope constructor: (@scope) -> @children = [] From a9803d3c4d9fc371edf6f3c600f79a5299284ddf Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 10:53:55 -0700 Subject: [PATCH 18/31] Add explicit return after for loop --- src/window-event-handler.coffee | 3 +++ src/workspace-view.coffee | 1 - src/workspace.coffee | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/window-event-handler.coffee b/src/window-event-handler.coffee index 1384f0c4a..593d33476 100644 --- a/src/window-event-handler.coffee +++ b/src/window-event-handler.coffee @@ -32,6 +32,8 @@ class WindowEventHandler unless fs.isDirectorySync(pathToOpen) atom.workspace?.open(pathToOpen, {initialLine, initialColumn}) + return + when 'update-available' atom.updateAvailable(detail) @@ -156,6 +158,7 @@ class WindowEventHandler continue unless tabIndex >= 0 callback(element, tabIndex) + return focusNext: => focusedTabIndex = parseInt($(':focus').attr('tabindex')) or -Infinity diff --git a/src/workspace-view.coffee b/src/workspace-view.coffee index addfe63c5..6a4a685d8 100644 --- a/src/workspace-view.coffee +++ b/src/workspace-view.coffee @@ -222,7 +222,6 @@ class WorkspaceView extends View for editorElement in @panes.element.querySelectorAll('atom-pane > .item-views > atom-text-editor') $(editorElement).view() - ### Section: Deprecated ### diff --git a/src/workspace.coffee b/src/workspace.coffee index 49f84f9b8..4afce1f37 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -110,6 +110,7 @@ class Workspace extends Model packageNames.push(packageName) for scopeName in includedGrammarScopes ? [] addGrammar(atom.grammars.grammarForScopeName(scopeName)) + return editors = @getTextEditors() addGrammar(editor.getGrammar()) for editor in editors From 23eacc1e58201e592167c4db860a0126c0dcfa77 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 10:56:42 -0700 Subject: [PATCH 19/31] Add explicit return after for loop --- src/menu-helpers.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/menu-helpers.coffee b/src/menu-helpers.coffee index a91523b82..aa346200c 100644 --- a/src/menu-helpers.coffee +++ b/src/menu-helpers.coffee @@ -17,6 +17,8 @@ merge = (menu, item, itemSpecificity=Infinity) -> else unless item.type is 'separator' and _.last(menu)?.type is 'separator' menu.push(item) + return + unmerge = (menu, item) -> matchingItemIndex = findMatchingItemIndex(menu, item) matchingItem = menu[matchingItemIndex] unless matchingItemIndex is - 1 From 9f31afcbc9ad7d80186e389cd1f39865cbd6764d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 10:57:55 -0700 Subject: [PATCH 20/31] Add explicit return after while loop --- src/package.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/src/package.coffee b/src/package.coffee index 44516261a..c0ab284e9 100644 --- a/src/package.coffee +++ b/src/package.coffee @@ -449,6 +449,7 @@ class Package @activateNow() break currentTarget = currentTarget.parentElement + return return getActivationCommands: -> From a72b1ccdf406d95be39f4f7eb3a929c520542b59 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 11:10:15 -0700 Subject: [PATCH 21/31] Mention array copying and explicit returns --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a5ebdd5f5..d2cf02bef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -104,6 +104,9 @@ For more information on how to work with Atom's official packages, see should be lower-case: * `getURI` instead of `getUri` * `uriToOpen` instead of `URIToOpen` +* Use `slice()` to copy an array +* Add an explicit `return` when your function ends with a `for`/`while` loop and + you don't want it to return a collected array. ## Documentation Styleguide From 576e00fb9363ffda732b646021fe166e443b0de0 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 11:57:16 -0700 Subject: [PATCH 22/31] Keep returning array from TextEditor::mutateSelectedText --- src/text-editor.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index d29013280..6ccb97392 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -844,7 +844,6 @@ class TextEditor extends Model @mergeIntersectingSelections => @transact => fn(selection, index) for selection, index in @getSelections() - return # Move lines intersection the most recent selection up by one row in screen # coordinates. From 2bfd30c832d0fea8001b021d697ef43879964db3 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 19 Mar 2015 14:37:39 -0600 Subject: [PATCH 23/31] Revert "Revert "Don't soft-wrap on indentation"" --- spec/display-buffer-spec.coffee | 18 ++++++++++++++++ spec/text-editor-component-spec.coffee | 4 ++-- src/tokenized-line.coffee | 30 ++++++++++++-------------- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/spec/display-buffer-spec.coffee b/spec/display-buffer-spec.coffee index 1703a24d1..95f22acca 100644 --- a/spec/display-buffer-spec.coffee +++ b/spec/display-buffer-spec.coffee @@ -115,6 +115,24 @@ describe "DisplayBuffer", -> expect(displayBuffer.tokenizedLineForScreenRow(3).text).toBe ' var pivot = items.shift(), current, left = [], ' expect(displayBuffer.tokenizedLineForScreenRow(4).text).toBe ' right = [];' + describe "when the only whitespace characters are at the beginning of the line", -> + beforeEach -> + displayBuffer.setEditorWidthInChars(10) + + it "wraps the line at the max length when indented with tabs", -> + buffer.setTextInRange([[0, 0], [1, 0]], '\t\tabcdefghijklmnopqrstuvwxyz') + + expect(displayBuffer.tokenizedLineForScreenRow(0).text).toBe ' abcdef' + expect(displayBuffer.tokenizedLineForScreenRow(1).text).toBe ' ghijkl' + expect(displayBuffer.tokenizedLineForScreenRow(2).text).toBe ' mnopqr' + + it "wraps the line at the max length when indented with spaces", -> + buffer.setTextInRange([[0, 0], [1, 0]], ' abcdefghijklmnopqrstuvwxyz') + + expect(displayBuffer.tokenizedLineForScreenRow(0).text).toBe ' abcdef' + expect(displayBuffer.tokenizedLineForScreenRow(1).text).toBe ' ghijkl' + expect(displayBuffer.tokenizedLineForScreenRow(2).text).toBe ' mnopqr' + describe "when there are hard tabs", -> beforeEach -> buffer.setText(buffer.getText().replace(new RegExp(' ', 'g'), '\t')) diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index f5c9e7677..20ddcdcab 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -1937,14 +1937,14 @@ describe "TextEditorComponent", -> gutterNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenRowInGutter(11), metaKey: true)) nextAnimationFrame() gutterNode.dispatchEvent(buildMouseEvent('mouseup', clientCoordinatesForScreenRowInGutter(11), metaKey: true)) - expect(editor.getSelectedScreenRanges()).toEqual [[[7, 4], [7, 6]], [[10, 0], [20, 0]]] + expect(editor.getSelectedScreenRanges()).toEqual [[[7, 4], [7, 6]], [[10, 0], [19, 0]]] it "merges overlapping selections", -> gutterNode.dispatchEvent(buildMouseEvent('mousedown', clientCoordinatesForScreenRowInGutter(17), metaKey: true)) gutterNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenRowInGutter(9), metaKey: true)) nextAnimationFrame() gutterNode.dispatchEvent(buildMouseEvent('mouseup', clientCoordinatesForScreenRowInGutter(9), metaKey: true)) - expect(editor.getSelectedScreenRanges()).toEqual [[[5, 0], [20, 0]]] + expect(editor.getSelectedScreenRanges()).toEqual [[[5, 0], [19, 0]]] describe "when the gutter is shift-clicked and dragged", -> describe "when the shift-click is below the existing selection's tail", -> diff --git a/src/tokenized-line.coffee b/src/tokenized-line.coffee index 2a807d84a..b62ab316f 100644 --- a/src/tokenized-line.coffee +++ b/src/tokenized-line.coffee @@ -11,6 +11,7 @@ module.exports = class TokenizedLine endOfLineInvisibles: null lineIsWhitespaceOnly: false + firstNonWhitespaceIndex: 0 foldable: false constructor: ({tokens, @lineEnding, @ruleStack, @startBufferColumn, @fold, @tabLength, @indentLevel, @invisibles}) -> @@ -96,6 +97,7 @@ class TokenizedLine # Returns a {Number} representing the `line` position where the wrap would take place. # Returns `null` if a wrap wouldn't occur. findWrapColumn: (maxColumn) -> + return unless maxColumn? return unless @text.length > maxColumn if /\s/.test(@text[maxColumn]) @@ -106,7 +108,7 @@ class TokenizedLine return @text.length else # search backward for the start of the word on the boundary - for column in [maxColumn..0] when @isColumnOutsideSoftWrapIndentation(column) + for column in [maxColumn..@firstNonWhitespaceIndex] return column + 1 if /\s/.test(@text[column]) return maxColumn @@ -127,12 +129,13 @@ class TokenizedLine rightTokens = new Array(@tokens...) leftTokens = [] - leftTextLength = 0 - while leftTextLength < column - if leftTextLength + rightTokens[0].value.length > column - rightTokens[0..0] = rightTokens[0].splitAt(column - leftTextLength) + leftScreenColumn = 0 + + while leftScreenColumn < column + if leftScreenColumn + rightTokens[0].screenDelta > column + rightTokens[0..0] = rightTokens[0].splitAt(column - leftScreenColumn) nextToken = rightTokens.shift() - leftTextLength += nextToken.value.length + leftScreenColumn += nextToken.screenDelta leftTokens.push nextToken indentationTokens = @buildSoftWrapIndentationTokens(leftTokens[0], hangingIndent) @@ -160,11 +163,6 @@ class TokenizedLine isSoftWrapped: -> @lineEnding is null - isColumnOutsideSoftWrapIndentation: (column) -> - return true if @softWrapIndentationTokens.length == 0 - - column > @softWrapIndentationDelta - isColumnInsideSoftWrapIndentation: (column) -> return false if @softWrapIndentationTokens.length == 0 @@ -209,15 +207,15 @@ class TokenizedLine outputTokens markLeadingAndTrailingWhitespaceTokens: -> - firstNonWhitespaceIndex = @text.search(NonWhitespaceRegex) - if firstNonWhitespaceIndex > 0 and isPairedCharacter(@text, firstNonWhitespaceIndex - 1) - firstNonWhitespaceIndex-- + @firstNonWhitespaceIndex = @text.search(NonWhitespaceRegex) + if @firstNonWhitespaceIndex > 0 and isPairedCharacter(@text, @firstNonWhitespaceIndex - 1) + @firstNonWhitespaceIndex-- firstTrailingWhitespaceIndex = @text.search(TrailingWhitespaceRegex) @lineIsWhitespaceOnly = firstTrailingWhitespaceIndex is 0 index = 0 for token in @tokens - if index < firstNonWhitespaceIndex - token.firstNonWhitespaceIndex = Math.min(index + token.value.length, firstNonWhitespaceIndex - index) + if index < @firstNonWhitespaceIndex + token.firstNonWhitespaceIndex = Math.min(index + token.value.length, @firstNonWhitespaceIndex - index) # Only the *last* segment of a soft-wrapped line can have trailing whitespace if @lineEnding? and (index + token.value.length > firstTrailingWhitespaceIndex) token.firstTrailingWhitespaceIndex = Math.max(0, firstTrailingWhitespaceIndex - index) From 5f76979fc83367d916e8962a6dd31c12983eff57 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 19 Mar 2015 15:08:36 -0600 Subject: [PATCH 24/31] Fix random editor spec now for indented soft-wrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We previously implemented soft-wrap logic again just for this test. Since the purpose of this test is just to make sure that mutation occurs correctly, we now instead construct a fresh editor for comparison so that changes to soft-wrap logic are reflected. /cc @as-cii Took care of this, so you don’t need to worry about my previous comment on your PR. Sorry for the noise. --- spec/random-editor-spec.coffee | 44 +++++++++------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/spec/random-editor-spec.coffee b/spec/random-editor-spec.coffee index bb5028d9a..d235ebc25 100644 --- a/spec/random-editor-spec.coffee +++ b/spec/random-editor-spec.coffee @@ -4,7 +4,7 @@ TextBuffer = require 'text-buffer' TextEditor = require '../src/text-editor' describe "TextEditor", -> - [editor, tokenizedBuffer, buffer, steps, previousSteps] = [] + [editor, tokenizedBuffer, buffer, steps] = [] softWrapColumn = 80 @@ -13,8 +13,6 @@ describe "TextEditor", -> atom.config.set('editor.preferredLineLength', softWrapColumn) it "properly renders soft-wrapped lines when randomly mutated", -> - previousSteps = JSON.parse(localStorage.steps ? '[]') - times 10, (i) -> buffer = new TextBuffer editor = new TextEditor({buffer}) @@ -47,6 +45,9 @@ describe "TextEditor", -> {bufferRows, screenLines} = getReferenceScreenLines() for bufferRow, screenRow in bufferRows console.log screenRow, bufferRow, screenLines[screenRow].text + console.log "==== steps to reproduce this failure: ===" + for step in steps + console.log 'editor.' + step[0] + '('+ step[1..].map((a) -> JSON.stringify(a)).join(', ') + ')' randomlyMutateEditor = -> if Math.random() < .2 @@ -79,34 +80,11 @@ describe "TextEditor", -> text getReferenceScreenLines = -> - if editor.isSoftWrapped() - screenLines = [] - bufferRows = [] - for bufferRow in [0..tokenizedBuffer.getLastRow()] - for screenLine in softWrapLine(tokenizedBuffer.tokenizedLineForRow(bufferRow)) - screenLines.push(screenLine) - bufferRows.push(bufferRow) - else - screenLines = tokenizedBuffer.tokenizedLines.slice() - bufferRows = [0..tokenizedBuffer.getLastRow()] + referenceEditor = new TextEditor({}) + referenceEditor.setEditorWidthInChars(80) + referenceEditor.setText(editor.getText()) + referenceEditor.setSoftWrapped(editor.isSoftWrapped()) + screenLines = referenceEditor.tokenizedLinesForScreenRows(0, referenceEditor.getLastScreenRow()) + bufferRows = referenceEditor.bufferRowsForScreenRows(0, referenceEditor.getLastScreenRow()) + {screenLines, bufferRows} - - softWrapLine = (tokenizedLine) -> - wrappedLines = [] - while tokenizedLine.text.length > softWrapColumn and wrapScreenColumn = findWrapColumn(tokenizedLine.text) - [wrappedLine, tokenizedLine] = tokenizedLine.softWrapAt(wrapScreenColumn) - wrappedLines.push(wrappedLine) - wrappedLines.push(tokenizedLine) - wrappedLines - - findWrapColumn = (line) -> - if /\s/.test(line[softWrapColumn]) - # search forward for the start of a word past the boundary - for column in [softWrapColumn..line.length] - return column if /\S/.test(line[column]) - return line.length - else - # search backward for the start of the word on the boundary - for column in [softWrapColumn..0] - return column + 1 if /\s/.test(line[column]) - return softWrapColumn From 9c74d1084994f2a20a7188cf6030abbdd742efe5 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 15:34:50 -0700 Subject: [PATCH 25/31] :arrow_up: text-buffer@5.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 801aac11c..bf610bb2a 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "space-pen": "3.8.2", "stacktrace-parser": "0.1.1", "temp": "0.8.1", - "text-buffer": "^5", + "text-buffer": "^5.0.1", "theorist": "^1.0.2", "underscore-plus": "^1.6.6" }, From 706222ce8ad67d315dbdab31cce0e2c80946a5df Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 15:51:51 -0700 Subject: [PATCH 26/31] :arrow_up: apm@0.147 --- apm/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apm/package.json b/apm/package.json index a989c7a83..374a7d98a 100644 --- a/apm/package.json +++ b/apm/package.json @@ -6,6 +6,6 @@ "url": "https://github.com/atom/atom.git" }, "dependencies": { - "atom-package-manager": "0.145.0" + "atom-package-manager": "0.147.0" } } From 2efee4a1a79657d3cebbcf4f927f703d226d4677 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 19 Mar 2015 16:06:55 -0700 Subject: [PATCH 27/31] :arrow_down: text-buffer@5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bf610bb2a..801aac11c 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "space-pen": "3.8.2", "stacktrace-parser": "0.1.1", "temp": "0.8.1", - "text-buffer": "^5.0.1", + "text-buffer": "^5", "theorist": "^1.0.2", "underscore-plus": "^1.6.6" }, From 895686575248808c2bb159c49c067dff98521c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C5=BDu=C5=BEak?= Date: Fri, 20 Mar 2015 15:46:55 +0100 Subject: [PATCH 28/31] :arrow_up: language-json@0.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 801aac11c..1f3be78ed 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "language-hyperlink": "0.12.2", "language-java": "0.14.0", "language-javascript": "0.63.0", - "language-json": "0.12.0", + "language-json": "0.13.0", "language-less": "0.25.0", "language-make": "0.14.0", "language-mustache": "0.11.0", From 6f17a4dae2758f753e636a1a3d61da24ee2e29d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20=C5=BDu=C5=BEak?= Date: Fri, 20 Mar 2015 16:00:03 +0100 Subject: [PATCH 29/31] :arrow_down: language-json@0.12 See https://github.com/atom/language-json/pull/16 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f3be78ed..801aac11c 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "language-hyperlink": "0.12.2", "language-java": "0.14.0", "language-javascript": "0.63.0", - "language-json": "0.13.0", + "language-json": "0.12.0", "language-less": "0.25.0", "language-make": "0.14.0", "language-mustache": "0.11.0", From a47744fd4842b8ff72cbab7b266e1f26554c261b Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 20 Mar 2015 10:49:06 -0600 Subject: [PATCH 30/31] :arrow_up: text-buffer to 5.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 801aac11c..a9faaa391 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "space-pen": "3.8.2", "stacktrace-parser": "0.1.1", "temp": "0.8.1", - "text-buffer": "^5", + "text-buffer": "^5.0.2", "theorist": "^1.0.2", "underscore-plus": "^1.6.6" }, From 6c38562e96821091b743e31c8a4fadd0aa4cd133 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Fri, 20 Mar 2015 16:31:09 -0700 Subject: [PATCH 31/31] :arrow_up: feedback@0.35.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a9faaa391..78560289a 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "dev-live-reload": "0.45.0", "encoding-selector": "0.19.0", "exception-reporting": "0.24.0", - "feedback": "0.34.0", + "feedback": "0.35.0", "find-and-replace": "0.159.0", "fuzzy-finder": "0.72.0", "git-diff": "0.54.0",