change toggle-fold to fold

This commit is contained in:
Corey Johnson
2012-07-27 11:47:30 -07:00
parent 20ff70115f
commit 76ffa5a2c5
4 changed files with 15 additions and 23 deletions

View File

@@ -56,17 +56,15 @@ class DisplayBuffer
@createFold(startRow, endRow)
toggleFoldAtBufferRow: (bufferRow) ->
foldScopeContainingBufferRow: (bufferRow) ->
for currentRow in [bufferRow..0]
[startRow, endRow] = @tokenizedBuffer.rowRangeForFoldAtBufferRow(currentRow) ? []
continue unless startRow? and startRow <= bufferRow <= endRow
fold = @largestFoldStartingAtBufferRow(startRow)
@createFold(startRow, endRow) unless fold
if fold = @largestFoldStartingAtBufferRow(startRow)
fold.destroy()
else
@createFold(startRow, endRow)
return
break
isFoldContainedByActiveFold: (fold) ->
for row, folds of @activeFolds