mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user