mirror of
https://github.com/atom/atom.git
synced 2026-02-07 13:14:55 -05:00
Use DisplayLayer.prototype.foldBufferRange in Selection.prototype.fold
This commit is contained in:
@@ -628,8 +628,8 @@ class Selection extends Model
|
||||
# Public: Creates a fold containing the current selection.
|
||||
fold: ->
|
||||
range = @getBufferRange()
|
||||
@editor.foldBufferRowRange(range.start.row, range.end.row)
|
||||
@cursor.setBufferPosition([range.end.row + 1, 0])
|
||||
@editor.foldBufferRange(range)
|
||||
@cursor.setBufferPosition(range.end)
|
||||
|
||||
# Private: Increase the indentation level of the given text by given number
|
||||
# of levels. Leaves the first line unchanged.
|
||||
|
||||
@@ -3009,6 +3009,9 @@ class TextEditor extends Model
|
||||
foldBufferRowRange: (startRow, endRow) ->
|
||||
@displayBuffer.foldBufferRowRange(startRow, endRow)
|
||||
|
||||
foldBufferRange: (range) ->
|
||||
@displayLayer.foldBufferRange(range)
|
||||
|
||||
# Remove any {Fold}s found that intersect the given buffer range.
|
||||
destroyFoldsIntersectingBufferRange: (bufferRange) ->
|
||||
@displayLayer.destroyFoldsIntersectingBufferRange(bufferRange)
|
||||
|
||||
Reference in New Issue
Block a user