mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
DisplayBuffer.destroyFoldsContainingBufferRow destroys all folds containing buffer row (instead of just folds starting at buffer row)
This commit is contained in:
@@ -108,8 +108,9 @@ class DisplayBuffer
|
||||
@trigger 'change', oldRange: oldScreenRange, newRange: newScreenRange, lineNumbersChanged: true
|
||||
|
||||
destroyFoldsContainingBufferRow: (bufferRow) ->
|
||||
folds = @activeFolds[bufferRow] ? []
|
||||
fold.destroy() for fold in new Array(folds...)
|
||||
for row, folds of @activeFolds
|
||||
for fold in new Array(folds...)
|
||||
fold.destroy() if fold.getBufferRange().containsRow(bufferRow)
|
||||
|
||||
registerFold: (fold) ->
|
||||
@activeFolds[fold.startRow] ?= []
|
||||
|
||||
@@ -50,6 +50,9 @@ class Range
|
||||
point = Point.fromObject(point)
|
||||
point.isGreaterThanOrEqual(@start) and point.isLessThanOrEqual(@end)
|
||||
|
||||
containsRow: (row) ->
|
||||
@start.row <= row <= @end.row
|
||||
|
||||
union: (otherRange) ->
|
||||
start = if @start.isLessThan(otherRange.start) then @start else otherRange.start
|
||||
end = if @end.isGreaterThan(otherRange.end) then @end else otherRange.end
|
||||
|
||||
Reference in New Issue
Block a user