From 49c9536358dac44e1979c3b66da263d8c124edf7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 25 Feb 2013 09:28:33 -0800 Subject: [PATCH] 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. --- src/app/language-mode.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/language-mode.coffee b/src/app/language-mode.coffee index 3e1c1512c..e8db1c774 100644 --- a/src/app/language-mode.coffee +++ b/src/app/language-mode.coffee @@ -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