summaryrefslogtreecommitdiff
path: root/public/vendor/codemirror/addon/fold/brace-fold.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/vendor/codemirror/addon/fold/brace-fold.js')
-rw-r--r--public/vendor/codemirror/addon/fold/brace-fold.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/public/vendor/codemirror/addon/fold/brace-fold.js b/public/vendor/codemirror/addon/fold/brace-fold.js
index 1605f6c2..13c0f0cd 100644
--- a/public/vendor/codemirror/addon/fold/brace-fold.js
+++ b/public/vendor/codemirror/addon/fold/brace-fold.js
@@ -13,7 +13,7 @@
CodeMirror.registerHelper("fold", "brace", function(cm, start) {
var line = start.line, lineText = cm.getLine(line);
- var startCh, tokenType;
+ var tokenType;
function findOpening(openCh) {
for (var at = start.ch, pass = 0;;) {
@@ -72,15 +72,15 @@ CodeMirror.registerHelper("fold", "import", function(cm, start) {
}
}
- var start = start.line, has = hasImport(start), prev;
- if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1))
+ var startLine = start.line, has = hasImport(startLine), prev;
+ if (!has || hasImport(startLine - 1) || ((prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1))
return null;
for (var end = has.end;;) {
var next = hasImport(end.line + 1);
if (next == null) break;
end = next.end;
}
- return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end};
+ return {from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), to: end};
});
CodeMirror.registerHelper("fold", "include", function(cm, start) {
@@ -91,14 +91,14 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) {
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
}
- var start = start.line, has = hasInclude(start);
- if (has == null || hasInclude(start - 1) != null) return null;
- for (var end = start;;) {
+ var startLine = start.line, has = hasInclude(startLine);
+ if (has == null || hasInclude(startLine - 1) != null) return null;
+ for (var end = startLine;;) {
var next = hasInclude(end + 1);
if (next == null) break;
++end;
}
- return {from: CodeMirror.Pos(start, has + 1),
+ return {from: CodeMirror.Pos(startLine, has + 1),
to: cm.clipPos(CodeMirror.Pos(end))};
});