Sha256: e301ea1454795cbca0c0572da1b593c64a768665b26658fae643148e609710f8

Contents?: true

Size: 1.52 KB

Versions: 9

Compression:

Stored size: 1.52 KB

Contents

(function(){function k(b){function e(a,c,d){if(a.text){var g=i?0:a.text.length-1,f=i?a.text.length:-1;for(null!=d&&(g=d+h);g!=f;g+=h)if(d=a.text.charAt(g),l.test(d)&&b.getTokenAt({line:c,ch:g+1}).type==k){var e=n[d];if(">"==e.charAt(1)==i)o.push(d);else{if(o.pop()!=e.charAt(0))return{pos:g,match:!1};if(!o.length)return{pos:g,match:!0}}}}}var a=b.getCursor(),f=b.getLineHandle(a.line),d=a.ch-1,c=0<=d&&n[f.text.charAt(d)]||n[f.text.charAt(++d)];if(!c)return null;for(var i=">"==c.charAt(1),h=i?1:-1,k=
b.getTokenAt({line:a.line,ch:d+1}).type,o=[f.text.charAt(d)],l=/[(){}[\]]/,c=a.line,j,m=i?Math.min(c+100,b.lineCount()):Math.max(-1,c-100);c!=m&&!(j=c==a.line?e(f,c,d):e(b.getLineHandle(c),c));c+=h);return{from:{line:a.line,ch:d},to:j&&{line:c,ch:j.pos},match:j&&j.match}}function l(b,e){var a=k(b);if(a){var f=a.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",d=b.markText(a.from,{line:a.from.line,ch:a.from.ch+1},{className:f}),c=a.to&&b.markText(a.to,{line:a.to.line,ch:a.to.ch+1},
{className:f}),a=function(){b.operation(function(){d.clear();c&&c.clear()})};if(e)setTimeout(a,800);else return a}}function m(b){b.operation(function(){h&&(h(),h=null);b.somethingSelected()||(h=l(b,!1))})}var n={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},h=null;CodeMirror.defineOption("matchBrackets",!1,function(b,e){if(e)b.on("cursorActivity",m);else b.off("cursorActivity",m)});CodeMirror.defineExtension("matchBrackets",function(){l(this,!0)});CodeMirror.defineExtension("findMatchingBracket",
function(){return k(this)})})();

Version data entries

9 entries across 6 versions & 1 rubygems

Version Path
rich-1.4.5 vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js
rich-1.4.5 vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/matchbrackets.js
rich-1.4.4 vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/matchbrackets.js
rich-1.4.4 vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js
rich-1.4.3 vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/matchbrackets.js
rich-1.4.3 vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/addon/edit/matchbrackets.js
rich-1.4.2 vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/matchbrackets.js
rich-1.4.1 vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/matchbrackets.js
rich-1.4 vendor/assets/ckeditor/ckeditor/plugins/codemirror/js/util/matchbrackets.js