mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user