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

PACJA Events

Maintenance mode is on

Site will be available soon. Thank you for your patience!