mirror of
https://github.com/atom/atom.git
synced 2026-02-09 14:15:24 -05:00
When DisplayBuffer.foldBufferRow is called with a buffer row that is within a fold, it folds the scope that incloses the buffer row's fold
This commit is contained in:
@@ -61,18 +61,14 @@ class DisplayBuffer
|
||||
[startRow, endRow] = @tokenizedBuffer.rowRangeForFoldAtBufferRow(currentRow) ? []
|
||||
continue unless startRow? and startRow <= bufferRow <= endRow
|
||||
fold = @largestFoldStartingAtBufferRow(startRow)
|
||||
@createFold(startRow, endRow) unless fold
|
||||
continue if fold
|
||||
|
||||
@createFold(startRow, endRow)
|
||||
|
||||
return
|
||||
|
||||
unfoldBufferRow: (bufferRow) ->
|
||||
for currentRow in [bufferRow..0]
|
||||
[startRow, endRow] = @tokenizedBuffer.rowRangeForFoldAtBufferRow(currentRow) ? []
|
||||
continue unless startRow? and startRow <= bufferRow <= endRow
|
||||
fold = @largestFoldStartingAtBufferRow(startRow)
|
||||
fold.destroy() if fold
|
||||
|
||||
return
|
||||
@largestFoldContainingBufferRow(bufferRow)?.destroy()
|
||||
|
||||
createFold: (startRow, endRow) ->
|
||||
return fold if fold = @foldFor(startRow, endRow)
|
||||
|
||||
Reference in New Issue
Block a user