From fb70833bc52aedffa3ed0764a31b706dd1fb3250 Mon Sep 17 00:00:00 2001 From: Cheng-Han, Wu Date: Wed, 1 Jun 2016 14:37:28 +0800 Subject: Update CodeMirror to version 5.15.3 --- public/vendor/codemirror/addon/fold/brace-fold.js | 16 ++++++++-------- public/vendor/codemirror/addon/fold/xml-fold.js | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'public/vendor/codemirror/addon/fold') 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))}; }); diff --git a/public/vendor/codemirror/addon/fold/xml-fold.js b/public/vendor/codemirror/addon/fold/xml-fold.js index 504727f3..f8c67b89 100644 --- a/public/vendor/codemirror/addon/fold/xml-fold.js +++ b/public/vendor/codemirror/addon/fold/xml-fold.js @@ -140,9 +140,9 @@ var openTag = toNextTag(iter), end; if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return; if (!openTag[1] && end != "selfClose") { - var start = Pos(iter.line, iter.ch); - var close = findMatchingClose(iter, openTag[2]); - return close && {from: start, to: close.from}; + var startPos = Pos(iter.line, iter.ch); + var endPos = findMatchingClose(iter, openTag[2]); + return endPos && {from: startPos, to: endPos.from}; } } }); -- cgit v1.2.3