mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
Merge pull request #9468 from atom/as-faster-unfold-all
Make LanguageMode::unfoldAll faster
This commit is contained in:
@@ -465,6 +465,10 @@ class DisplayBuffer extends Model
|
||||
|
||||
folds
|
||||
|
||||
# Returns all the folds that intersect the given row range.
|
||||
foldsIntersectingBufferRowRange: (startRow, endRow) ->
|
||||
@foldForMarker(marker) for marker in @findFoldMarkers(intersectsRowRange: [startRow, endRow])
|
||||
|
||||
# Public: Given a buffer row, this returns folds that include it.
|
||||
#
|
||||
#
|
||||
|
||||
@@ -97,8 +97,8 @@ class LanguageMode
|
||||
|
||||
# Unfolds all the foldable lines in the buffer.
|
||||
unfoldAll: ->
|
||||
for row in [@buffer.getLastRow()..0] by -1
|
||||
fold.destroy() for fold in @editor.displayBuffer.foldsStartingAtBufferRow(row)
|
||||
for fold in @editor.displayBuffer.foldsIntersectingBufferRowRange(0, @buffer.getLastRow()) by -1
|
||||
fold.destroy()
|
||||
return
|
||||
|
||||
# Fold all comment and code blocks at a given indentLevel
|
||||
|
||||
Reference in New Issue
Block a user