fix code folding in equation mode

This commit is contained in:
Daniel Felder 2014-08-11 12:21:20 +00:00
commit ed320af6f4

View file

@ -74,7 +74,7 @@ oop.inherits(FoldMode, BaseFoldMode);
var stream = new TokenIterator(session, row, column);
var token = stream.getCurrentToken();
if (!token || token.type !== "storage.type")
if (!token || !(token.type == "storage.type" || token.type == "constant.character.escape"))
return;
var val = token.value;
@ -96,7 +96,7 @@ oop.inherits(FoldMode, BaseFoldMode);
stream.step = dir === -1 ? stream.stepBackward : stream.stepForward;
while(token = stream.step()) {
if (token.type !== "storage.type")
if (!token || !(token.type == "storage.type" || token.type == "constant.character.escape"))
continue;
var level = keywords[token.value];
if (!level)