CodeMirror.registerHelper("fold","comment",function(e,t){var n=e.getModeAt(t),r=n.blockCommentStart,i=n.blockCommentEnd;if(!r||!i)return;var s=t.line,o=e.getLine(s),u;for(var a=t.ch,f=0;;){var l=a<=0?-1:o.lastIndexOf(r,a-1);if(l==-1){if(f==1)return;f=1,a=o.length;continue}if(f==1&&l<t.ch)return;if(/comment/.test(e.getTokenTypeAt(CodeMirror.Pos(s,l+1)))){u=l+r.length;break}a=l-1}var c=1,h=e.lastLine(),p,d;e:for(var v=s;v<=h;++v){var m=e.getLine(v),g=v==s?u:0;for(;;){var y=m.indexOf(r,g),b=m.indexOf(i,g);y<0&&(y=m.length),b<0&&(b=m.length),g=Math.min(y,b);if(g==m.length)break;if(g==y)++c;else if(!--c){p=v,d=g;break e}++g}}if(p==null||s==p&&d==u)return;return{from:CodeMirror.Pos(s,u),to:CodeMirror.Pos(p,d)}});