Don't make commented lines foldable based on the next line's indentation

Only the first line of a set of commented lines should be foldable, even
if some of the lines in the block are indented.
This commit is contained in:
Nathan Sobo
2014-01-20 14:29:08 -07:00
parent 86106cbf4d
commit 525b5c9978
2 changed files with 6 additions and 1 deletions

View File

@@ -190,7 +190,7 @@ class LanguageMode
# Private: Returns a {Boolean} indicating whether the given buffer row starts
# a a foldable row range due to the code's indentation patterns.
isFoldableCodeAtBufferRow: (bufferRow) ->
return false if @editor.isBufferRowBlank(bufferRow)
return false if @editor.isBufferRowBlank(bufferRow) or @isLineCommentedAtBufferRow(bufferRow)
nextNonEmptyRow = @editor.nextNonBlankBufferRow(bufferRow)
return false unless nextNonEmptyRow?
@editor.indentationForBufferRow(nextNonEmptyRow) > @editor.indentationForBufferRow(bufferRow)