Fix exception when trying to fold non-foldable row

This commit is contained in:
Max Brunsfeld
2017-10-23 10:20:45 -07:00
parent 43ec5193ff
commit 8d532e7780
2 changed files with 22 additions and 2 deletions

View File

@@ -3310,8 +3310,8 @@ class TextEditor extends Model
# level.
foldCurrentRow: ->
{row} = @getCursorBufferPosition()
range = @tokenizedBuffer.getFoldableRangeContainingPoint(Point(row, Infinity))
@displayLayer.foldBufferRange(range)
if range = @tokenizedBuffer.getFoldableRangeContainingPoint(Point(row, Infinity))
@displayLayer.foldBufferRange(range)
# Essential: Unfold the most recent cursor's row by one level.
unfoldCurrentRow: ->