From 26bcf7718b0aa80f8d7fc06331adcc50375e015d Mon Sep 17 00:00:00 2001 From: Mutwin Kraus Date: Thu, 4 Apr 2013 15:03:35 +0200 Subject: [PATCH] Revert "Selection support for bracket matcher" This reverts commit 460c4a0b09bb5b87acc6448fa23a32462b824f8b. --- .../lib/bracket-matcher.coffee | 20 ------------------- .../spec/bracket-matcher-spec.coffee | 11 ---------- 2 files changed, 31 deletions(-) diff --git a/src/packages/bracket-matcher/lib/bracket-matcher.coffee b/src/packages/bracket-matcher/lib/bracket-matcher.coffee index 18c4c6f55..4d80300fa 100644 --- a/src/packages/bracket-matcher/lib/bracket-matcher.coffee +++ b/src/packages/bracket-matcher/lib/bracket-matcher.coffee @@ -30,8 +30,6 @@ module.exports = editor.on 'cursor:moved.bracket-matcher', => @updateMatch(editor) editor.command 'editor:go-to-matching-bracket.bracket-matcher', => @goToMatchingPair(editor) - editor.command 'editor:select-to-matching-bracket.bracket-matcher', => - @selectToMatchingPair(editor) editor.on 'editor:will-be-removed', => editor.off('.bracket-matcher') editor.startHighlightView = @addHighlightView(editor) editor.endHighlightView = @addHighlightView(editor) @@ -59,24 +57,6 @@ module.exports = else if previousPosition.isEqual(endPosition) editor.setCursorBufferPosition(startPosition) - selectToMatchingPair: (editor) -> - return unless @pairHighlighted - return unless underlayer = editor.getPane()?.find('.underlayer') - - position = editor.getCursorBufferPosition() - previousPosition = position.translate([0, -1]) - startPosition = underlayer.find('.bracket-matcher:first').data('bufferPosition') - endPosition = underlayer.find('.bracket-matcher:last').data('bufferPosition') - - if position.isEqual(startPosition) - editor.selectToScreenPosition(editor.screenPositionForBufferPosition(endPosition.translate([0, 1]))) - else if previousPosition.isEqual(startPosition) - editor.selectToScreenPosition(editor.screenPositionForBufferPosition(endPosition)) - else if position.isEqual(endPosition) - editor.selectToScreenPosition(editor.screenPositionForBufferPosition(startPosition.translate([0, 1]))) - else if previousPosition.isEqual(endPosition) - editor.selectToScreenPosition(editor.screenPositionForBufferPosition(startPosition)) - moveHighlightViews: (editor, bufferRange) -> { start, end } = Range.fromObject(bufferRange) startPixelPosition = editor.pixelPositionForBufferPosition(start) diff --git a/src/packages/bracket-matcher/spec/bracket-matcher-spec.coffee b/src/packages/bracket-matcher/spec/bracket-matcher-spec.coffee index 58c971c6c..9a44ba3a7 100644 --- a/src/packages/bracket-matcher/spec/bracket-matcher-spec.coffee +++ b/src/packages/bracket-matcher/spec/bracket-matcher-spec.coffee @@ -86,17 +86,6 @@ describe "bracket matching", -> editor.trigger "editor:go-to-matching-bracket" expect(editor.getCursorBufferPosition()).toEqual [0, 28] - describe "when editor:select-to-matching-bracket is triggered", -> - it " selects until the next matched bracket", -> - editor.moveCursorToEndOfLine() - editor.moveCursorLeft() - editor.trigger "editor:select-to-matching-bracket" - expect(editor.getCursorBufferPosition()).toEqual [12, 1] - selections = editor.getSelections() - expect(selections.length).toBe(1) - range = selections[0].getBufferRange() - expect(range).toEqual([[0,28], [12,1]]) - describe "matching bracket insertion", -> beforeEach -> editSession.buffer.setText("")