Guard against no fold end regex

Not all bundles specify this and an error will be
raised when trying to fold inside a grammar that does
not have this property defined if this check isn't done.
This commit is contained in:
Kevin Sawicki
2013-02-25 09:28:33 -08:00
parent 8b92b15b58
commit 49c9536358

View File

@@ -78,7 +78,7 @@ class LanguageMode
continue if @editSession.isBufferRowBlank(row)
indentation = @editSession.indentationForBufferRow(row)
if indentation <= startIndentLevel
includeRowInFold = indentation == startIndentLevel and @foldEndRegexForScopes(scopes).search(@editSession.lineForBufferRow(row))
includeRowInFold = indentation == startIndentLevel and @foldEndRegexForScopes(scopes)?.search(@editSession.lineForBufferRow(row))
foldEndRow = row if includeRowInFold
break