{:uriI"¶file://app/assets/javascripts/admin/codemirror/addon/fold/indent-fold.js?type=application/javascript&pipeline=self&id=5d463e45d3b0ee5eb63d5fc7292f1eaeeb1ec5332c4ebcac83bba6566d10e6e8:ET:load_pathI"app/assets/javascripts;T: filenameI"Fapp/assets/javascripts/admin/codemirror/addon/fold/indent-fold.js;T: nameI",admin/codemirror/addon/fold/indent-fold;T:logical_pathI"4admin/codemirror/addon/fold/indent-fold.self.js;T:content_typeI"application/javascript;T: sourceI"‰// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; function lineIndent(cm, lineNo) { var text = cm.getLine(lineNo) var spaceTo = text.search(/\S/) if (spaceTo == -1 || /\bcomment\b/.test(cm.getTokenTypeAt(CodeMirror.Pos(lineNo, spaceTo + 1)))) return -1 return CodeMirror.countColumn(text, null, cm.getOption("tabSize")) } CodeMirror.registerHelper("fold", "indent", function(cm, start) { var myIndent = lineIndent(cm, start.line) if (myIndent < 0) return var lastLineInFold = null // Go through lines until we find a line that definitely doesn't belong in // the block we're folding, or to the end. for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { var indent = lineIndent(cm, i) if (indent == -1) { } else if (indent > myIndent) { // Lines with a greater indent are considered part of the block. lastLineInFold = i; } else { // If this line has non-space, non-comment content, and is // indented less or equal to the start line, it is the start of // another block. break; } } if (lastLineInFold) return { from: CodeMirror.Pos(start.line, cm.getLine(start.line).length), to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) }; }); }); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"Tfile-digest://app/assets/javascripts/admin/codemirror/addon/fold/indent-fold.js;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%Üj÷–ùÿäM×&K3=&Ð&øÁ•„g²Æp¢qóR´d: lengthi‰:dependencies_digest"%Ù÷ M:4R9rÕ–R©d˜¶ƒÌ8à‚–ú€ædo&:idI"E5d463e45d3b0ee5eb63d5fc7292f1eaeeb1ec5332c4ebcac83bba6566d10e6e8;F: mtimel+´?…[