Fix dòng
•
/
home
/
barbar84
/
www
/
wp-inclu...
/
js
/
codemirr...
•
File:
codemirror.min.js
•
Dòng [
18
/
28
]:
return c.repeatIsExplicit&&(e=c.repeat-a.getOption("firstLineNumber")),d(e,la(a.getLine(e)))},textObjectManipulation:function(a,b,c,d){var e={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},f={"'":!0,'"':!0},g=c.selectedCharacter;"b"==g?g="(":"B"==g&&(g="{");var h,i=!c.textObjectInner;if(e[g])h=xa(a,b,g,i);else if(f[g])h=ya(a,b,g,i);else if("W"===g)h=ma(a,i,!0,!0);else if("w"===g)h=ma(a,i,!0,!1);else{if("p"!==g)return null;if(h=wa(a,b,c.repeat,0,i),c.linewise=!0,d.visualMode)d.visualLine||(d.visualLine=!0);else{var j=d.inputState.operatorArgs;j&&(j.linewise=!0),h.end.line--}}return a.state.vim.visualMode?ea(a,h.start,h.end):[h.start,h.end]},repeatLastCharacterSearch:function(a,b,c){var d=vb.lastCharacterSearch,e=c.repeat,f=c.forward===d.forward,g=(d.increment?1:0)*(f?-1:1);a.moveH(-g,"char"),c.inclusive=!!f;var h=sa(a,e,f,d.selectedCharacter);return h?(h.ch+=g,h):(a.moveH(g,"char"),b)}},Ab={change:function(b,c,e){var f,g,h=b.state.vim;if(vb.macroModeState.lastInsertModeChanges.inVisualBlock=h.visualBlock,h.visualMode){g=b.getSelection();var i=G("",e.length);b.replaceSelections(i),f=U(e[0].head,e[0].anchor)}else{var j=e[0].anchor,k=e[0].head;g=b.getRange(j,k);var l=h.lastEditInputState||{};if("moveByWords"==l.motion&&!r(g)){var m=/\s+$/.exec(g);m&&l.motionArgs&&l.motionArgs.forward&&(k=L(k,0,-m[0].length),g=g.slice(0,-m[0].length))}var n=new d(j.line-1,Number.MAX_VALUE),o=b.firstLine()==b.lastLine();k.line>b.lastLine()&&c.linewise&&!o?b.replaceRange("",n,k):b.replaceRange("",j,k),c.linewise&&(o||(b.setCursor(n),a.commands.newlineAndIndent(b)),j.ch=Number.MAX_VALUE),f=j}vb.registerController.pushText(c.registerName,"change",g,c.linewise,e.length>1),Bb.enterInsertMode(b,{head:f},b.state.vim)},"delete":function(a,b,c){var e,f,g=a.state.vim;if(g.visualBlock){f=a.getSelection();var h=G("",c.length);a.replaceSelections(h),e=c[0].anchor}else{var i=c[0].anchor,j=c[0].head;b.linewise&&j.line!=a.firstLine()&&i.line==a.lastLine()&&i.line==j.line-1&&(i.line==a.firstLine()?i.ch=0:i=d(i.line-1,X(a,i.line-1))),f=a.getRange(i,j),a.replaceRange("",i,j),e=i,b.linewise&&(e=zb.moveToFirstNonWhiteSpaceCharacter(a,i))}return vb.registerController.pushText(b.registerName,"delete",f,b.linewise,g.visualBlock),J(a,e)},indent:function(a,b,c){var d=a.state.vim,e=c[0].anchor.line,f=d.visualBlock?c[c.length-1].anchor.line:c[0].head.line,g=d.visualMode?b.repeat:1;b.linewise&&f--;for(var h=e;h<=f;h++)for(var i=0;i<g;i++)a.indentLine(h,b.indentRight);return zb.moveToFirstNonWhiteSpaceCharacter(a,c[0].anchor)},changeCase:function(a,b,c,d,e){for(var f=a.getSelections(),g=[],h=b.toLower,i=0;i<f.length;i++){var j=f[i],k="";if(h===!0)k=j.toLowerCase();else if(h===!1)k=j.toUpperCase();else for(var l=0;l<j.length;l++){var m=j.charAt(l);k+=q(m)?m.toLowerCase():m.toUpperCase()}g.push(k)}return a.replaceSelections(g),b.shouldMoveCursor?e:!a.state.vim.visualMode&&b.linewise&&c[0].anchor.line+1==c[0].head.line?zb.moveToFirstNonWhiteSpaceCharacter(a,d):b.linewise?d:U(c[0].anchor,c[0].head)},yank:function(a,b,c,d){var e=a.state.vim,f=a.getSelection(),g=e.visualMode?U(e.sel.anchor,e.sel.head,c[0].head,c[0].anchor):d;return vb.registerController.pushText(b.registerName,"yank",f,b.linewise,e.visualBlock),g}},Bb={jumpListWalk:function(a,b,c){if(!c.visualMode){var d=b.repeat,e=b.forward,f=vb.jumpList,g=f.move(a,e?d:-d),h=g?g.find():void 0;h=h?h:a.getCursor(),a.setCursor(h)}},scroll:function(a,b,c){if(!c.visualMode){var d=b.repeat||1,e=a.defaultTextHeight(),f=a.getScrollInfo().top,g=e*d,h=b.forward?f+g:f-g,i=R(a.getCursor()),j=a.charCoords(i,"local");if(b.forward)h>j.top?(i.line+=(h-j.top)/e,i.line=Math.ceil(i.line),a.setCursor(i),j=a.charCoords(i,"local"),a.scrollTo(null,j.top)):a.scrollTo(null,h);else{var k=h+a.getScrollInfo().clientHeight;k<j.bottom?(i.line-=(j.bottom-k)/e,i.line=Math.floor(i.line),a.setCursor(i),j=a.charCoords(i,"local"),a.scrollTo(null,j.bottom-a.getScrollInfo().clientHeight)):a.scrollTo(null,h)}}},scrollToCursor:function(a,b){var c=a.getCursor().line,e=a.charCoords(d(c,0),"local"),f=a.getScrollInfo().clientHeight,g=e.top,h=e.bottom-g;switch(b.position){case"center":g=g-f/2+h;break;case"bottom":g=g-f+h}a.scrollTo(null,g)},replayMacro:function(a,b,c){var d=b.selectedCharacter,e=b.repeat,f=vb.macroModeState;for("@"==d&&(d=f.latestRegister);e--;)Ya(a,c,f,d)},enterMacroRecordMode:function(a,b){var c=vb.macroModeState,d=b.selectedCharacter;vb.registerController.isValidRegister(d)&&c.enterMacroRecordMode(a,d)},toggleOverwrite:function(b){b.state.overwrite?(b.toggleOverwrite(!1),b.setOption("keyMap","vim-insert"),a.signal(b,"vim-mode-change",{mode:"insert"})):(b.toggleOverwrite(!0),b.setOption("keyMap","vim-replace"),a.signal(b,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(b,c,e){if(!b.getOption("readOnly")){e.insertMode=!0,e.insertModeRepeat=c&&c.repeat||1;var f=c?c.insertAt:null,g=e.sel,h=c.head||b.getCursor("head"),i=b.listSelections().length;if("eol"==f)h=d(h.line,X(b,h.line));else if("charAfter"==f)h=L(h,0,1);else if("firstNonBlank"==f)h=zb.moveToFirstNonWhiteSpaceCharacter(b,h);else if("startOfSelectedArea"==f)e.visualBlock?(h=d(Math.min(g.head.line,g.anchor.line),Math.min(g.head.ch,g.anchor.ch)),i=Math.abs(g.head.line-g.anchor.line)+1):h=g.head.line<g.anchor.line?g.head:d(g.anchor.line,0);else if("endOfSelectedArea"==f)e.visualBlock?(h=d(Math.min(g.head.line,g.anchor.line),Math.max(g.head.ch+1,g.anchor.ch)),i=Math.abs(g.head.line-g.anchor.line)+1):h=g.head.line>=g.anchor.line?L(g.head,0,1):d(g.anchor.line,0);else if("inplace"==f&&e.visualMode)return;b.setOption("disableInput",!1),c&&c.replace?(b.toggleOverwrite(!0),b.setOption("keyMap","vim-replace"),a.signal(b,"vim-mode-change",{mode:"replace"})):(b.toggleOverwrite(!1),b.setOption("keyMap","vim-insert"),a.signal(b,"vim-mode-change",{mode:"insert"})),vb.macroModeState.isPlaying||(b.on("change",ab),a.on(b.getInputField(),"keydown",fb)),e.visualMode&&ia(b),aa(b,h,i)}},toggleVisualMode:function(b,c,e){var f,g=c.repeat,h=b.getCursor();e.visualMode?e.visualLine^c.linewise||e.visualBlock^c.blockwise?(e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,a.signal(b,"vim-mode-change",{mode:"visual",subMode:e.visualLine?"linewise":e.visualBlock?"blockwise":""}),fa(b)):ia(b):(e.visualMode=!0,e.visualLine=!!c.linewise,e.visualBlock=!!c.blockwise,f=J(b,d(h.line,h.ch+g-1),!0),e.sel={anchor:h,head:f},a.signal(b,"vim-mode-change",{mode:"visual",subMode:e.visualLine?"linewise":e.visualBlock?"blockwise":""}),fa(b),ua(b,e,"<",U(h,f)),ua(b,e,">",V(h,f)))},reselectLastSelection:function(b,c,d){var e=d.lastSelection;if(d.visualMode&&da(b,d),e){var f=e.anchorMark.find(),g=e.headMark.find();if(!f||!g)return;d.sel={anchor:f,head:g},d.visualMode=!0,d.visualLine=e.visualLine,d.visualBlock=e.visualBlock,fa(b),ua(b,d,"<",U(f,g)),ua(b,d,">",V(f,g)),a.signal(b,"vim-mode-change",{mode:"visual",subMode:d.visualLine?"linewise":d.visualBlock?"blockwise":""})}},joinLines:function(a,b,c){var e,f;if(c.visualMode){if(e=a.getCursor("anchor"),f=a.getCursor("head"),T(f,e)){var g=f;f=e,e=g}f.ch=X(a,f.line)-1}else{var h=Math.max(b.repeat,2);e=a.getCursor(),f=J(a,d(e.line+h-1,1/0))}for(var i=0,j=e.line;j<f.line;j++){i=X(a,e.line);var g=d(e.line+1,X(a,e.line+1)),k=a.getRange(e,g);k=k.replace(/\n\s*/g," "),a.replaceRange(k,e,g)}var l=d(e.line,i);c.visualMode&&ia(a,!1),a.setCursor(l)},newLineAndEnterInsertMode:function(b,c,e){e.insertMode=!0;var f=R(b.getCursor());if(f.line!==b.firstLine()||c.after){f.line=c.after?f.line:f.line-1,f.ch=X(b,f.line),b.setCursor(f);var g=a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent;g(b)}else b.replaceRange("\n",d(b.firstLine(),0)),b.setCursor(b.firstLine(),0);this.enterInsertMode(b,{repeat:c.repeat},e)},paste:function(a,b,c){var e=R(a.getCursor()),f=vb.registerController.getRegister(b.registerName),g=f.toString();if(g){if(b.matchIndent){var h=a.getOption("tabSize"),i=function(a){var b=a.split("\t").length-1,c=a.split(" ").length-1;return b*h+1*c},j=a.getLine(a.getCursor().line),k=i(j.match(/^\s*/)[0]),l=g.replace(/\n$/,""),m=g!==l,n=i(g.match(/^\s*/)[0]),g=l.replace(/^\s*/gm,function(b){var c=k+(i(b)-n);if(c<0)return"";if(a.getOption("indentWithTabs")){var d=Math.floor(c/h);return Array(d+1).join("\t")}return Array(c+1).join(" ")});g+=m?"\n":""}if(b.repeat>1)var g=Array(b.repeat+1).join(g);var o=f.linewise,p=f.blockwise;if(o)c.visualMode?g=c.visualLine?g.slice(0,-1):"\n"+g.slice(0,g.length-1)+"\n":b.after?(g="\n"+g.slice(0,g.length-1),e.ch=X(a,e.line)):e.ch=0;else{if(p){g=g.split("\n");for(var q=0;q<g.length;q++)g[q]=""==g[q]?" ":g[q]}e.ch+=b.after?1:0}var r,s;if(c.visualMode){c.lastPastedText=g;var t,u=ca(a,c),v=u[0],w=u[1],x=a.getSelection(),y=a.listSelections(),z=new Array(y.length).join("1").split("1");c.lastSelection&&(t=c.lastSelection.headMark.find()),vb.registerController.unnamedRegister.setText(x),p?(a.replaceSelections(z),w=d(v.line+g.length-1,v.ch),a.setCursor(v),_(a,w),a.replaceSelections(g),r=v):c.visualBlock?(a.replaceSelections(z),a.setCursor(v),a.replaceRange(g,v,v),r=v):(a.replaceRange(g,v,w),r=a.posFromIndex(a.indexFromPos(v)+g.length-1)),t&&(c.lastSelection.headMark=a.setBookmark(t)),o&&(r.ch=0)}else if(p){a.setCursor(e);for(var q=0;q<g.length;q++){var A=e.line+q;A>a.lastLine()&&a.replaceRange("\n",d(A,0));var B=X(a,A);B<e.ch&&$(a,A,e.ch)}a.setCursor(e),_(a,d(e.line+g.length-1,e.ch)),a.replaceSelections(g),r=e}else a.replaceRange(g,e),o&&b.after?r=d(e.line+1,la(a.getLine(e.line+1))):o&&!b.after?r=d(e.line,la(a.getLine(e.line))):!o&&b.after?(s=a.indexFromPos(e),r=a.posFromIndex(s+g.length-1)):(s=a.indexFromPos(e),r=a.posFromIndex(s+g.length));c.visualMode&&ia(a,!1),a.setCursor(r)}},undo:function(b,c){b.operation(function(){Q(b,a.commands.undo,c.repeat)(),b.setCursor(b.getCursor("anchor"))})},redo:function(b,c){Q(b,a.commands.redo,c.repeat)()},setRegister:function(a,b,c){c.inputState.registerName=b.selectedCharacter},setMark:function(a,b,c){var d=b.selectedCharacter;ua(a,c,d,a.getCursor())},replace:function(b,c,e){var f,g,h=c.selectedCharacter,i=b.getCursor(),j=b.listSelections();if(e.visualMode)i=b.getCursor("start"),g=b.getCursor("end");else{var k=b.getLine(i.line);f=i.ch+c.repeat,f>k.length&&(f=k.length),g=d(i.line,f)}if("\n"==h)e.visualMode||b.replaceRange("",i,g),(a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent)(b);else{var l=b.getRange(i,g);if(l=l.replace(/[^\n]/g,h),e.visualBlock){var m=new Array(b.getOption("tabSize")+1).join(" ");l=b.getSelection(),l=l.replace(/\t/g,m).replace(/[^\n]/g,h).split("\n"),b.replaceSelections(l)}else b.replaceRange(l,i,g);e.visualMode?(i=T(j[0].anchor,j[0].head)?j[0].anchor:j[0].head,b.setCursor(i),ia(b,!1)):b.setCursor(L(g,0,-1))}},incrementNumberToken:function(a,b){for(var c,e,f,g,h,i=a.getCursor(),j=a.getLine(i.line),k=/-?\d+/g;null!==(c=k.exec(j))&&(h=c[0],e=c.index,f=e+h.length,!(i.ch<f)););if((b.backtrack||!(f<=i.ch))&&h){var l=b.increase?1:-1,m=parseInt(h)+l*b.repeat,n=d(i.line,e),o=d(i.line,f);g=m.toString(),a.replaceRange(g,n,o),a.setCursor(d(i.line,e+g.length-1))}},repeatLastEdit:function(a,b,c){var d=c.lastEditInputState;if(d){var e=b.repeat;e&&b.repeatIsExplicit?c.lastEditInputState.repeatOverride=e:e=c.lastEditInputState.repeatOverride||e,gb(a,c,e,!1)}},indent:function(a,b){a.indentLine(a.getCursor().line,b.indentRight)},exitInsertMode:Va},Cb={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Db={bracket:{isComplete:function(a){if(a.nextCh===a.symb){if(a.depth++,a.depth>=1)return!0}else a.nextCh===a.reverseSymb&&a.depth--;return!1}},section:{init:function(a){a.curMoveThrough=!0,a.symb=(a.forward?"]":"[")===a.symb?"{":"}"},isComplete:function(a){return 0===a.index&&a.nextCh===a.symb}},comment:{isComplete:function(a){var b="*"===a.lastCh&&"/"===a.nextCh;return a.lastCh=a.nextCh,b}},method:{init:function(a){a.symb="m"===a.symb?"{":"}",a.reverseSymb="{"===a.symb?"}":"{"},isComplete:function(a){return a.nextCh===a.symb}},preprocess:{init:function(a){a.index=0},isComplete:function(a){if("#"===a.nextCh){var b=a.lineText.match(/#(\w+)/)[1];if("endif"===b){if(a.forward&&0===a.depth)return!0;a.depth++}else if("if"===b){if(!a.forward&&0===a.depth)return!0;a.depth--}if("else"===b&&0===a.depth)return!0}return!1}}};t("pcre",!0,"boolean"),za.prototype={getQuery:function(){return vb.query},setQuery:function(a){vb.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=a},isReversed:function(){return vb.isReversed},setReversed:function(a){vb.isReversed=a},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(a){this.annotate=a}};var Eb={"\\n":"\n","\\r":"\r","\\t":"\t"},Fb={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"},Gb="(Javascript regexp)",Hb=function(){this.buildCommandMap_()};Hb.prototype={processCommand:function(a,b,c){var d=this;a.operation(function(){a.curOp.isVimOp=!0,d._processCommand(a,b,c)})},_processCommand:function(b,c,d){var e=b.state.vim,f=vb.registerController.getRegister(":"),g=f.toString();e.visualMode&&ia(b);var h=new a.StringStream(c);f.setText(c);var i=d||{};i.input=c;try{this.parseInput_(b,h,i)}catch(j){throw Ia(b,j),j}var k,l;if(i.commandName){if(k=this.matchCommand_(i.commandName)){if(l=k.name,k.excludeFromCommandHistory&&f.setText(g),this.parseCommandArgs_(h,i,k),"exToKey"==k.type){for(var m=0;m<k.toKeys.length;m++)a.Vim.handleKey(b,k.toKeys[m],"mapping");return}if("exToEx"==k.type)return void this.processCommand(b,k.toInput)}}else void 0!==i.line&&(l="move");if(!l)return void Ia(b,'Not an editor command ":'+c+'"');try{Ib[l](b,i),k&&k.possiblyAsync||!i.callback||i.callback()}catch(j){throw Ia(b,j),j}},parseInput_:function(a,b,c){b.eatWhile(":"),b.eat("%")?(c.line=a.firstLine(),c.lineEnd=a.lastLine()):(c.line=this.parseLineSpec_(a,b),void 0!==c.line&&b.eat(",")&&(c.lineEnd=this.parseLineSpec_(a,b)));var d=b.match(/^(\w+)/);return d?c.commandName=d[1]:c.commandName=b.match(/.*/)[0],c},parseLineSpec_:function(a,b){var c=b.match(/^(\d+)/);if(c)return parseInt(c[1],10)-1;switch(b.next()){case".":return this.parseLineSpecOffset_(b,a.getCursor().line);case"$":return this.parseLineSpecOffset_(b,a.lastLine());case"'":var d=b.next(),e=Ta(a,a.state.vim,d);if(!e)throw new Error("Mark not set");return this.parseLineSpecOffset_(b,e.line);case"-":case"+":return b.backUp(1),this.parseLineSpecOffset_(b,a.getCursor().line);default:return void b.backUp(1)}},parseLineSpecOffset_:function(a,b){var c=a.match(/^([+-])?(\d+)/);if(c){var d=parseInt(c[2],10);"-"==c[1]?b-=d:b+=d}return b},parseCommandArgs_:function(a,b,c){if(!a.eol()){b.argString=a.match(/.*/)[0];var d=c.argDelimiter||/\s+/,e=Y(b.argString).split(d);e.length&&e[0]&&(b.args=e)}},matchCommand_:function(a){for(var b=a.length;b>0;b--){var c=a.substring(0,b);if(this.commandMap_[c]){var d=this.commandMap_[c];if(0===d.name.indexOf(a))return d}}return null},buildCommandMap_:function(){this.commandMap_={};for(var a=0;a<c.length;a++){var b=c[a],d=b.shortName||b.name;this.commandMap_[d]=b}},map:function(a,c,d){if(":"!=a&&":"==a.charAt(0)){if(d)throw Error("Mode not supported for ex mappings");var e=a.substring(1);":"!=c&&":"==c.charAt(0)?this.commandMap_[e]={name:e,type:"exToEx",toInput:c.substring(1),user:!0}:this.commandMap_[e]={name:e,type:"exToKey",toKeys:c,user:!0}}else if(":"!=c&&":"==c.charAt(0)){var f={keys:a,type:"keyToEx",exArgs:{input:c.substring(1)}};d&&(f.context=d),b.unshift(f)}else{var f={keys:a,type:"keyToKey",toKeys:c};d&&(f.context=d),b.unshift(f)}},unmap:function(a,c){if(":"!=a&&":"==a.charAt(0)){if(c)throw Error("Mode not supported for ex mappings");var d=a.substring(1);if(this.commandMap_[d]&&this.commandMap_[d].user)return void delete this.commandMap_[d]}else for(var e=a,f=0;f<b.length;f++)if(e==b[f].keys&&b[f].context===c)return void b.splice(f,1);throw Error("No such mapping.")}};var Ib={colorscheme:function(a,b){return!b.args||b.args.length<1?void Ia(a,a.getOption("theme")):void a.setOption("theme",b.args[0])},map:function(a,b,c){var d=b.args;return!d||d.length<2?void(a&&Ia(a,"Invalid mapping: "+b.input)):void Jb.map(d[0],d[1],c)},imap:function(a,b){this.map(a,b,"insert")},nmap:function(a,b){this.map(a,b,"normal")},vmap:function(a,b){this.map(a,b,"visual")},unmap:function(a,b,c){var d=b.args;return!d||d.length<1?void(a&&Ia(a,"No such mapping: "+b.input)):void Jb.unmap(d[0],c)},move:function(a,b){yb.processCommand(a,a.state.vim,{type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:b.line+1})},set:function(a,b){var c=b.args,d=b.setCfg||{};if(!c||c.length<1)return void(a&&Ia(a,"Invalid mapping: "+b.input));var e=c[0].split("="),f=e[0],g=e[1],h=!1;if("?"==f.charAt(f.length-1)){if(g)throw Error("Trailing characters: "+b.argString);f=f.substring(0,f.length-1),h=!0}void 0===g&&"no"==f.substring(0,2)&&(f=f.substring(2),g=!1);var i=sb[f]&&"boolean"==sb[f].type;if(i&&void 0==g&&(g=!0),!i&&void 0===g||h){var j=v(f,a,d);j instanceof Error?Ia(a,j.message):j===!0||j===!1?Ia(a," "+(j?"":"no")+f):Ia(a," "+f+"="+j)}else{var k=u(f,g,a,d);k instanceof Error&&Ia(a,k.message)}},setlocal:function(a,b){b.setCfg={scope:"local"},this.set(a,b)},setglobal:function(a,b){b.setCfg={scope:"global"},this.set(a,b)},registers:function(a,b){var c=b.args,d=vb.registerController.registers,e="----------Registers----------<br><br>";if(c){var f;c=c.join("");for(var g=0;g<c.length;g++)if(f=c.charAt(g),vb.registerController.isValidRegister(f)){var h=d[f]||new B;e+='"'+f+" "+h.toString()+"<br>"}}else for(var f in d){var i=d[f].toString();i.length&&(e+='"'+f+" "+i+"<br>")}Ia(a,e)},sort:function(b,c){function e(){if(c.argString){var b=new a.StringStream(c.argString);if(b.eat("!")&&(h=!0),b.eol())return;if(!b.eatSpace())return"Invalid arguments";var d=b.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!d&&!b.eol())return"Invalid arguments";if(d[1]){i=d[1].indexOf("i")!=-1,j=d[1].indexOf("u")!=-1;var e=d[1].indexOf("d")!=-1||d[1].indexOf("n")!=-1&&1,f=d[1].indexOf("x")!=-1&&1,g=d[1].indexOf("o")!=-1&&1;if(e+f+g>1)return"Invalid arguments";k=e&&"decimal"||f&&"hex"||g&&"octal"}d[2]&&(l=new RegExp(d[2].substr(1,d[2].length-2),i?"i":""))}}function f(a,b){if(h){var c;c=a,a=b,b=c}i&&(a=a.toLowerCase(),b=b.toLowerCase());var d=k&&s.exec(a),e=k&&s.exec(b);return d?(d=parseInt((d[1]+d[2]).toLowerCase(),t),e=parseInt((e[1]+e[2]).toLowerCase(),t),d-e):a<b?-1:1}function g(a,b){if(h){var c;c=a,a=b,b=c}return i&&(a[0]=a[0].toLowerCase(),b[0]=b[0].toLowerCase()),a[0]<b[0]?-1:1}var h,i,j,k,l,m=e();if(m)return void Ia(b,m+": "+c.argString);var n=c.line||b.firstLine(),o=c.lineEnd||c.line||b.lastLine();if(n!=o){var p=d(n,0),q=d(o,X(b,o)),r=b.getRange(p,q).split("\n"),s=l?l:"decimal"==k?/(-?)([\d]+)/:"hex"==k?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==k?/([0-7]+)/:null,t="decimal"==k?10:"hex"==k?16:"octal"==k?8:null,u=[],v=[];if(k||l)for(var w=0;w<r.length;w++){var x=l?r[w].match(l):null;x&&""!=x[0]?u.push(x):!l&&s.exec(r[w])?u.push(r[w]):v.push(r[w])}else v=r;if(u.sort(l?g:f),l)for(var w=0;w<u.length;w++)u[w]=u[w].input;else k||v.sort(f);if(r=h?u.concat(v):v.concat(u),j){var y,z=r;r=[];for(var w=0;w<z.length;w++)z[w]!=y&&r.push(z[w]),y=z[w]}b.replaceRange(r.join("\n"),p,q)}},global:function(a,b){var c=b.argString;if(!c)return void Ia(a,"Regular Expression missing from global");var d,e=void 0!==b.line?b.line:a.firstLine(),f=b.lineEnd||b.line||a.lastLine(),g=Ca(c),h=c;if(g.length&&(h=g[0],d=g.slice(1,g.length).join("/")),h)try{Ma(a,h,!0,!0)}catch(i){return void Ia(a,"Invalid regex: "+h)}for(var j=Aa(a).getQuery(),k=[],l="",m=e;m<=f;m++){var n=j.test(a.getLine(m));n&&(k.push(m+1),l+=a.getLine(m)+"<br>")}if(!d)return void Ia(a,l);var o=0,p=function(){if(o<k.length){var b=k[o]+d;Jb.processCommand(a,b,{callback:p})}o++};p()},substitute:function(a,b){if(!a.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var c,e,f,g,h=b.argString,i=h?Ca(h):[],j="",k=!1,l=!1;if(i.length)c=i[0],j=i[1],c&&"$"===c[c.length-1]&&(c=c.slice(0,c.length-1)+"\\n",j=j?j+"\n":"\n"),void 0!==j&&(j=v("pcre")?Ga(j):Fa(j),vb.lastSubstituteReplacePart=j),e=i[2]?i[2].split(" "):[];else if(h&&h.length)return void Ia(a,"Substitutions should be of the form :s/pattern/replace/");if(e&&(f=e[0],g=parseInt(e[1]),f&&(f.indexOf("c")!=-1&&(k=!0,f.replace("c","")),f.indexOf("g")!=-1&&(l=!0,f.replace("g","")),c=c+"/"+f)),c)try{Ma(a,c,!0,!0)}catch(m){return void Ia(a,"Invalid regex: "+c)}if(j=j||vb.lastSubstituteReplacePart,void 0===j)return void Ia(a,"No previous substitute regular expression");var n=Aa(a),o=n.getQuery(),p=void 0!==b.line?b.line:a.getCursor().line,q=b.lineEnd||p;p==a.firstLine()&&q==a.lastLine()&&(q=1/0),g&&(p=q,q=p+g-1);var r=J(a,d(p,0)),s=a.getSearchCursor(o,r);Ua(a,k,l,p,q,s,o,j,b.callback)},redo:a.commands.redo,undo:a.commands.undo,write:function(b){a.commands.save?a.commands.save(b):b.save&&b.save()},nohlsearch:function(a){Qa(a)},yank:function(a){var b=R(a.getCursor()),c=b.line,d=a.getLine(c);vb.registerController.pushText("0","yank",d,!0,!0)},delmarks:function(b,c){if(!c.argString||!Y(c.argString))return void Ia(b,"Argument required");for(var d=b.state.vim,e=new a.StringStream(Y(c.argString));!e.eol();){e.eatSpace();var f=e.pos;if(!e.match(/[a-zA-Z]/,!1))return void Ia(b,"Invalid argument: "+c.argString.substring(f));var g=e.next();if(e.match("-",!0)){if(!e.match(/[a-zA-Z]/,!1))return void Ia(b,"Invalid argument: "+c.argString.substring(f));var h=g,i=e.next();if(!(n(h)&&n(i)||q(h)&&q(i)))return void Ia(b,"Invalid argument: "+h+"-");var j=h.charCodeAt(0),k=i.charCodeAt(0);if(j>=k)return void Ia(b,"Invalid argument: "+c.argString.substring(f));for(var l=0;l<=k-j;l++){var m=String.fromCharCode(j+l);delete d.marks[m]}}else delete d.marks[g]}}},Jb=new Hb;return a.keyMap.vim={attach:h,detach:g,call:i},t("insertModeEscKeysTimeout",200,"number"),a.keyMap["vim-insert"]={fallthrough:["default"],attach:h,detach:g,call:i},a.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:h,detach:g,call:i},y(),xb};a.Vim=e()})},{"../addon/dialog/dialog":3,"../addon/edit/matchbrackets.js":12,"../addon/search/searchcursor":49,"../lib/codemirror":59}],59:[function(a,b,c){!function(a,d){"object"==typeof c&&"undefined"!=typeof b?b.exports=d():"function"==typeof define&&define.amd?define(d):a.CodeMirror=d()}(this,function(){"use strict";function a(a){return new RegExp("(^|\\s)"+a+"(?:$|\\s)\\s*")}function b(a){for(var b=a.childNodes.length;b>0;--b)a.removeChild(a.firstChild);return a}function c(a,c){return b(a).appendChild(c)}function d(a,b,c,d){var e=document.createElement(a);if(c&&(e.className=c),d&&(e.style.cssText=d),"string"==typeof b)e.appendChild(document.createTextNode(b));else if(b)for(var f=0;f<b.length;++f)e.appendChild(b[f]);return e}function e(a,b,c,e){var f=d(a,b,c,e);return f.setAttribute("role","presentation"),f}function f(a,b){if(3==b.nodeType&&(b=b.parentNode),a.contains)return a.contains(b);do if(11==b.nodeType&&(b=b.host),b==a)return!0;while(b=b.parentNode)}function g(){var a;try{a=document.activeElement}catch(b){a=document.body||null}for(;a&&a.shadowRoot&&a.shadowRoot.activeElement;)a=a.shadowRoot.activeElement;return a}function h(b,c){var d=b.className;a(c).test(d)||(b.className+=(d?" ":"")+c)}function i(b,c){for(var d=b.split(" "),e=0;e<d.length;e++)d[e]&&!a(d[e]).test(c)&&(c+=" "+d[e]);return c}function j(a){var b=Array.prototype.slice.call(arguments,1);return function(){return a.apply(null,b)}}function k(a,b,c){b||(b={});for(var d in a)!a.hasOwnProperty(d)||c===!1&&b.hasOwnProperty(d)||(b[d]=a[d]);return b}function l(a,b,c,d,e){null==b&&(b=a.search(/[^\s\u00a0]/),b==-1&&(b=a.length));for(var f=d||0,g=e||0;;){var h=a.indexOf("\t",f);if(h<0||h>=b)return g+(b-f);g+=h-f,g+=c-g%c,f=h+1}}function m(a,b){for(var c=0;c<a.length;++c)if(a[c]==b)return c;return-1}function n(a,b,c){for(var d=0,e=0;;){var f=a.indexOf("\t",d);f==-1&&(f=a.length);var g=f-d;if(f==a.length||e+g>=b)return d+Math.min(g,b-e);if(e+=f-d,e+=c-e%c,d=f+1,e>=b)return d}}function o(a){for(;Qg.length<=a;)Qg.push(p(Qg)+" ");return Qg[a]}function p(a){return a[a.length-1]}function q(a,b){for(var c=[],d=0;d<a.length;d++)c[d]=b(a[d],d);return c}function r(a,b,c){for(var d=0,e=c(b);d<a.length&&c(a[d])<=e;)d++;a.splice(d,0,b)}function s(){}function t(a,b){var c;return Object.create?c=Object.create(a):(s.prototype=a,c=new s),b&&k(b,c),c}function u(a){return/\w/.test(a)||a>"\x80"&&(a.toUpperCase()!=a.toLowerCase()||Rg.test(a))}function v(a,b){return b?!!(b.source.indexOf("\\w")>-1&&u(a))||b.test(a):u(a)}function w(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function x(a){return a.charCodeAt(0)>=768&&Sg.test(a)}function y(a,b,c){for(;(c<0?b>0:b<a.length)&&x(a.charAt(b));)b+=c;return b}function z(a,b,c){for(;;){if(Math.abs(b-c)<=1)return a(b)?b:c;var d=Math.floor((b+c)/2);a(d)?c=d:b=d}}function A(a,b,c){var f=this;this.input=c,f.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),f.scrollbarFiller.setAttribute("cm-not-content","true"),f.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),f.gutterFiller.setAttribute("cm-not-content","true"),f.lineDiv=e("div",null,"CodeMirror-code"),f.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),f.cursorDiv=d("div",null,"CodeMirror-cursors"),f.measure=d("div",null,"CodeMirror-measure"),f.lineMeasure=d("div",null,"CodeMirror-measure"),f.lineSpace=e("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");var g=e("div",[f.lineSpace],"CodeMirror-lines");f.mover=d("div",[g],null,"position: relative"),f.sizer=d("div",[f.mover],"CodeMirror-sizer"),f.sizerWidth=null,f.heightForcer=d("div",null,null,"position: absolute; height: "+Lg+"px; width: 1px;"),f.gutters=d("div",null,"CodeMirror-gutters"),f.lineGutter=null,f.scroller=d("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll"),f.scroller.setAttribute("tabIndex","-1"),f.wrapper=d("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror"),ng&&og<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0),pg||jg&&yg||(f.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(f.wrapper):a(f.wrapper)),f.viewFrom=f.viewTo=b.first,f.reportedViewFrom=f.reportedViewTo=b.first,f.view=[],f.renderedView=null,f.externalMeasured=null,f.viewOffset=0,f.lastWrapHeight=f.lastWrapWidth=0,f.updateLineNumbers=null,f.nativeBarWidth=f.barHeight=f.barWidth=0,f.scrollbarsClipped=!1,f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null,f.alignWidgets=!1,f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null,f.maxLine=null,f.maxLineLength=0,f.maxLineChanged=!1,f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null,f.shift=!1,f.selForContextMenu=null,f.activeTouch=null,c.init(f)}function B(a,b){if(b-=a.first,b<0||b>=a.size)throw new Error("There is no line "+(b+a.first)+" in the document.");for(var c=a;!c.lines;)for(var d=0;;++d){var e=c.children[d],f=e.chunkSize();if(b<f){c=e;break}b-=f}return c.lines[b]}function C(a,b,c){var d=[],e=b.line;return a.iter(b.line,c.line+1,function(a){var f=a.text;e==c.line&&(f=f.slice(0,c.ch)),e==b.line&&(f=f.slice(b.ch)),d.push(f),++e}),d}function D(a,b,c){var d=[];return a.iter(b,c,function(a){d.push(a.text)}),d}function E(a,b){var c=b-a.height;if(c)for(var d=a;d;d=d.parent)d.height+=c}function F(a){if(null==a.parent)return null;for(var b=a.parent,c=m(b.lines,a),d=b.parent;d;b=d,d=d.parent)for(var e=0;d.children[e]!=b;++e)c+=d.children[e].chunkSize();return c+b.first}function G(a,b){var c=a.first;a:do{for(var d=0;d<a.children.length;++d){var e=a.children[d],f=e.height;if(b<f){a=e;continue a}b-=f,c+=e.chunkSize()}return c}while(!a.lines);for(var g=0;g<a.lines.length;++g){var h=a.lines[g],i=h.height;if(b<i)break;b-=i}return c+g}function H(a,b){return b>=a.first&&b<a.first+a.size}function I(a,b){return String(a.lineNumberFormatter(b+a.firstLineNumber))}function J(a,b,c){return void 0===c&&(c=null),this instanceof J?(this.line=a,this.ch=b,void(this.sticky=c)):new J(a,b,c)}function K(a,b){return a.line-b.line||a.ch-b.ch}function L(a,b){return a.sticky==b.sticky&&0==K(a,b)}function M(a){return J(a.line,a.ch)}function N(a,b){return K(a,b)<0?b:a}function O(a,b){return K(a,b)<0?a:b}function P(a,b){return Math.max(a.first,Math.min(b,a.first+a.size-1))}function Q(a,b){if(b.line<a.first)return J(a.first,0);var c=a.first+a.size-1;return b.line>c?J(c,B(a,c).text.length):R(b,B(a,b.line).text.length)}function R(a,b){var c=a.ch;return null==c||c>b?J(a.line,b):c<0?J(a.line,0):a}function S(a,b){for(var c=[],d=0;d<b.length;d++)c[d]=Q(a,b[d]);return c}function T(){Tg=!0}function U(){Ug=!0}function V(a,b,c){this.marker=a,this.from=b,this.to=c}function W(a,b){if(a)for(var c=0;c<a.length;++c){var d=a[c];if(d.marker==b)return d}}function X(a,b){for(var c,d=0;d<a.length;++d)a[d]!=b&&(c||(c=[])).push(a[d]);return c}function Y(a,b){a.markedSpans=a.markedSpans?a.markedSpans.concat([b]):[b],b.marker.attachLine(a)}function Z(a,b,c){var d;if(a)for(var e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);if(h||f.from==b&&"bookmark"==g.type&&(!c||!f.marker.insertLeft)){var i=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);(d||(d=[])).push(new V(g,f.from,i?null:f.to))}}return d}function $(a,b,c){var d;if(a)for(var e=0;e<a.length;++e){var f=a[e],g=f.marker,h=null==f.to||(g.inclusiveRight?f.to>=b:f.to>b);if(h||f.from==b&&"bookmark"==g.type&&(!c||f.marker.insertLeft)){var i=null==f.from||(g.inclusiveLeft?f.from<=b:f.from<b);(d||(d=[])).push(new V(g,i?null:f.from-b,null==f.to?null:f.to-b))}}return d}function _(a,b){if(b.full)return null;var c=H(a,b.from.line)&&B(a,b.from.line).markedSpans,d=H(a,b.to.line)&&B(a,b.to.line).markedSpans;if(!c&&!d)return null;var e=b.from.ch,f=b.to.ch,g=0==K(b.from,b.to),h=Z(c,e,g),i=$(d,f,g),j=1==b.text.length,k=p(b.text).length+(j?e:0);if(h)for(var l=0;l<h.length;++l){var m=h[l];if(null==m.to){var n=W(i,m.marker);n?j&&(m.to=null==n.to?null:n.to+k):m.to=e}}if(i)for(var o=0;o<i.length;++o){var q=i[o];if(null!=q.to&&(q.to+=k),null==q.from){var r=W(h,q.marker);r||(q.from=k,j&&(h||(h=[])).push(q))}else q.from+=k,j&&(h||(h=[])).push(q)}h&&(h=aa(h)),i&&i!=h&&(i=aa(i));var s=[h];if(!j){var t,u=b.text.length-2;if(u>0&&h)for(var v=0;v<h.length;++v)null==h[v].to&&(t||(t=[])).push(new V(h[v].marker,null,null));for(var w=0;w<u;++w)s.push(t);s.push(i)}return s}function aa(a){for(var b=0;b<a.length;++b){var c=a[b];null!=c.from&&c.from==c.to&&c.marker.clearWhenEmpty!==!1&&a.splice(b--,1)}return a.length?a:null}function ba(a,b,c){var d=null;if(a.iter(b.line,c.line+1,function(a){if(a.markedSpans)for(var b=0;b<a.markedSpans.length;++b){var c=a.markedSpans[b].marker;!c.readOnly||d&&m(d,c)!=-1||(d||(d=[])).push(c)}}),!d)return null;for(var e=[{from:b,to:c}],f=0;f<d.length;++f)for(var g=d[f],h=g.find(0),i=0;i<e.length;++i){var j=e[i];if(!(K(j.to,h.from)<0||K(j.from,h.to)>0)){var k=[i,1],l=K(j.from,h.from),n=K(j.to,h.to);(l<0||!g.inclusiveLeft&&!l)&&k.push({from:j.from,to:h.from}),(n>0||!g.inclusiveRight&&!n)&&k.push({from:h.to,to:j.to}),e.splice.apply(e,k),i+=k.length-3}}return e}function ca(a){var b=a.markedSpans;if(b){for(var c=0;c<b.length;++c)b[c].marker.detachLine(a);a.markedSpans=null}}function da(a,b){if(b){for(var c=0;c<b.length;++c)b[c].marker.attachLine(a);a.markedSpans=b}}function ea(a){return a.inclusiveLeft?-1:0}function fa(a){return a.inclusiveRight?1:0}function ga(a,b){var c=a.lines.length-b.lines.length;if(0!=c)return c;var d=a.find(),e=b.find(),f=K(d.from,e.from)||ea(a)-ea(b);if(f)return-f;var g=K(d.to,e.to)||fa(a)-fa(b);return g?g:b.id-a.id}function ha(a,b){var c,d=Ug&&a.markedSpans;if(d)for(var e=void 0,f=0;f<d.length;++f)e=d[f],e.marker.collapsed&&null==(b?e.from:e.to)&&(!c||ga(c,e.marker)<0)&&(c=e.marker);return c}function ia(a){return ha(a,!0)}function ja(a){return ha(a,!1)}function ka(a,b,c,d,e){var f=B(a,b),g=Ug&&f.markedSpans;if(g)for(var h=0;h<g.length;++h){var i=g[h];if(i.marker.collapsed){var j=i.marker.find(0),k=K(j.from,c)||ea(i.marker)-ea(e),l=K(j.to,d)||fa(i.marker)-fa(e);
Delete
Ấn tiếp tục để lưu lại ở lại trang và ấn lưu để lưu lại và quay về List dòng
Function
Delete dòng
Edit by line
Edit text
Download
Information
Rename
Copy
Move
Delete
Chmod
List