Vergleich admin/jscripts/codemirror/addon/fold/brace-fold.js - 1.8.7 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 13Zeile 13

CodeMirror.registerHelper("fold", "brace", function(cm, start) {
var line = start.line, lineText = cm.getLine(line);


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;;) {


function findOpening(openCh) {
for (var at = start.ch, pass = 0;;) {

Zeile 72Zeile 72
    }
}


    }
}


  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 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) {

});

CodeMirror.registerHelper("fold", "include", function(cm, start) {

Zeile 91Zeile 91
    if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
}


    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;
}

    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))};
});


          to: cm.clipPos(CodeMirror.Pos(end))};
});