text: !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(d){var t=/\S/g,p=String.prototype.repeat||function(e){return Array(e+1).join(this)};function o(n){if(n.getOption("disableInput"))return d.Pass;for(var e,t=n.listSelections(),o=[],i=0;i<t.length;i++){var l=t[i].head;if(!/\bcomment\b/.test(n.getTokenTypeAt(l)))return d.Pass;var c=n.getModeAt(l);if(e){if(e!=c)return d.Pass}else e=c;var r,m,u,a=null,f=e.blockCommentStart,s=e.lineComment;if(f&&e.blockCommentContinue&&(-1!=(c=(r=n.getLine(l.line)).lastIndexOf(e.blockCommentEnd,l.ch-e.blockCommentEnd.length))&&c==l.ch-e.blockCommentEnd.length||s&&-1<(m=r.lastIndexOf(s,l.ch-1))&&/\bcomment\b/.test(n.getTokenTypeAt({line:l.line,ch:m+1}))||(l.ch>=f.length&&-1<(m=r.lastIndexOf(f,l.ch-f.length))&&c<m?a=h(0,r)>=m?r.slice(0,m):(c=n.options.tabSize,m=d.countColumn(r,m,c),n.options.indentWithTabs?p.call("\t",u=Math.floor(m/c))+p.call(" ",m-c*u):p.call(" ",m)):-1<(m=r.indexOf(e.blockCommentContinue))&&m<=l.ch&&m<=h(0,r)&&(a=r.slice(0,m))),null!=a&&(a+=e.blockCommentContinue)),null==a&&s&&function(e){e=e.getOption("continueComments");return!e||"object"!=typeof e||!1!==e.continueLineComment}(n)&&(m=(r=null==r?n.getLine(l.line):r).indexOf(s),l.ch||m?-1<m&&h(0,r)>=m&&(a=(a=!(a=-1<h(l.ch,r))?-1<(l=(u=n.getLine(l.line+1)||"").indexOf(s))&&h(0,u)>=l||null:a)&&r.slice(0,m)+s+r.slice(m+s.length).match(/^\s*/)[0]):a=""),null==a)return d.Pass;o[i]="\n"+a}n.operation(function(){for(var e=t.length-1;0<=e;e--)n.replaceRange(o[e],t[e].from(),t[e].to(),"+insert")})}function h(e,n){t.lastIndex=e;n=t.exec(n);return n?n.index:-1}d.defineOption("continueComments",null,function(e,n,t){t&&t!=d.Init&&e.removeKeyMap("continueComment"),n&&(t="Enter","string"==typeof n?t=n:"object"==typeof n&&n.key&&(t=n.key),(n={name:"continueComment"})[t]=o,e.addKeyMap(n))})});