diff --git a/package.json b/package.json index 4e1216846..a447d53b5 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "service-hub": "^0.7.4", "sinon": "1.17.4", "temp": "^0.8.3", - "text-buffer": "13.6.0-0", + "text-buffer": "13.6.0-2", "typescript-simple": "1.0.0", "underscore-plus": "^1.6.6", "winreg": "^1.2.1", diff --git a/src/selection.coffee b/src/selection.coffee index 0907888d6..cb45286b8 100644 --- a/src/selection.coffee +++ b/src/selection.coffee @@ -87,7 +87,7 @@ class Selection extends Model setBufferRange: (bufferRange, options={}) -> bufferRange = Range.fromObject(bufferRange) options.reversed ?= @isReversed() - @editor.destroyFoldsContainingBufferPositions([bufferRange.start, bufferRange.end]) unless options.preserveFolds + @editor.destroyFoldsContainingBufferPositions([bufferRange.start, bufferRange.end], true) unless options.preserveFolds @modifySelection => needsFlash = options.flash delete options.flash if options.flash? diff --git a/src/text-editor-component.js b/src/text-editor-component.js index 641cdad02..f19b7e31c 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -1771,7 +1771,7 @@ class TextEditorComponent { if (target && target.matches('.fold-marker')) { const bufferPosition = model.bufferPositionForScreenPosition(screenPosition) - model.destroyFoldsIntersectingBufferRange(Range(bufferPosition, bufferPosition)) + model.destroyFoldsContainingBufferPositions([bufferPosition], false) return } diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 400d48f97..dd359df9e 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -2497,7 +2497,7 @@ class TextEditor extends Model addSelectionForBufferRange: (bufferRange, options={}) -> bufferRange = Range.fromObject(bufferRange) unless options.preserveFolds - @displayLayer.destroyFoldsContainingBufferPositions([bufferRange.start, bufferRange.end]) + @displayLayer.destroyFoldsContainingBufferPositions([bufferRange.start, bufferRange.end], true) @selectionsMarkerLayer.markBufferRange(bufferRange, {invalidate: 'never', reversed: options.reversed ? false}) @getLastSelection().autoscroll() unless options.autoscroll is false @getLastSelection() @@ -3318,8 +3318,7 @@ class TextEditor extends Model # Essential: Unfold the most recent cursor's row by one level. unfoldCurrentRow: -> {row} = @getCursorBufferPosition() - position = Point(row, Infinity) - @displayLayer.destroyFoldsIntersectingBufferRange(Range(position, position)) + @displayLayer.destroyFoldsContainingBufferPositions([Point(row, Infinity)], false) # Essential: Fold the given row in buffer coordinates based on its indentation # level. @@ -3348,7 +3347,7 @@ class TextEditor extends Model # * `bufferRow` A {Number} unfoldBufferRow: (bufferRow) -> position = Point(bufferRow, Infinity) - @displayLayer.destroyFoldsIntersectingBufferRange(Range(position, position)) + @displayLayer.destroyFoldsContainingBufferPositions([position]) # Extended: For each selection, fold the rows it intersects. foldSelectedLines: -> @@ -3447,9 +3446,9 @@ class TextEditor extends Model destroyFoldsIntersectingBufferRange: (bufferRange) -> @displayLayer.destroyFoldsIntersectingBufferRange(bufferRange) - # Remove any {Fold}s found that intersect the given array of buffer positions. - destroyFoldsContainingBufferPositions: (bufferPositions) -> - @displayLayer.destroyFoldsContainingBufferPositions(bufferPositions) + # Remove any {Fold}s found that contain the given array of buffer positions. + destroyFoldsContainingBufferPositions: (bufferPositions, excludeEndpoints) -> + @displayLayer.destroyFoldsContainingBufferPositions(bufferPositions, excludeEndpoints) ### Section: Gutters