Nested folds can start at the same row as the fold that contains them

...still need to test destroying the outer fold though.
This commit is contained in:
Nathan Sobo
2012-05-18 20:14:05 -06:00
parent 9757786257
commit c491d92437
2 changed files with 14 additions and 7 deletions

View File

@@ -137,7 +137,7 @@ class Renderer
while startBufferRow <= endBufferRow
screenLine = @highlighter.lineForRow(startBufferRow)
if fold = @foldForBufferRow(startBufferRow)
if fold = @largestFoldForBufferRow(startBufferRow)
screenLine = screenLine.copy()
screenLine.fold = fold
screenLine.bufferDelta = fold.getBufferDelta()
@@ -184,8 +184,9 @@ class Renderer
_.remove(folds, fold)
delete @foldsById[fold.id]
foldForBufferRow: (bufferRow) ->
@activeFolds[bufferRow]?[0]
largestFoldForBufferRow: (bufferRow) ->
return unless folds = @activeFolds[bufferRow]
(folds.sort (a, b) -> b.endRow - a.endRow)[0]
buildFoldPlaceholder: (fold) ->