web-interface.assets.d09463c099fb2c44719380623a5c68fb.js Maven / Gradle / Ivy
(()=>{var an=(E,Y)=>()=>(Y||E((Y={exports:{}}).exports,Y),Y.exports);var on=an((ar,Ye)=>{ace.define("ace/ext/hardwrap",["require","exports","module","ace/range","ace/editor","ace/config"],function(E,Y,or){"use strict";var We=E("../range").Range;function J(se,V){for(var z=V.column||se.getOption("printMarginColumn"),Ke=V.allowMerge!=!1,j=Math.min(V.startRow,V.endRow),Re=Math.max(V.startRow,V.endRow),Me=se.session;j<=Re;){var le=Me.getLine(j);if(le.length>z){var ve=I(le,z,5);if(ve){var y=/^\s*/.exec(le)[0];Me.replace(new We(j,ve.start,j,ve.end),`
`+y)}Re++}else if(Ke&&/\S/.test(le)&&j!=Re){var q=Me.getLine(j+1);if(q&&/\S/.test(q)){var T=le.replace(/\s+$/,""),je=q.replace(/^\s+/,""),g=T+" "+je,ve=I(g,z,5);if(ve&&ve.start>T.length||g.lengthQ)return{start:ne.index,end:ne.index+ne[2].length};if(ue&&ue[2])return G=re+ue[2].length,{start:G,end:G+ue[3].length}}}}function Ue(se){if(se.command.name=="insertstring"&&/\S/.test(se.args)){var V=se.editor,z=V.selection.cursor;if(z.column<=V.renderer.$printMarginColumn)return;var Ke=V.session.$undoManager.$lastDelta;J(V,{startRow:z.row,endRow:z.row,allowMerge:!1}),Ke!=V.session.$undoManager.$lastDelta&&V.session.markUndoGroup()}}var Te=E("../editor").Editor;E("../config").defineOptions(Te.prototype,"editor",{hardWrap:{set:function(se){se?this.commands.on("afterExec",Ue):this.commands.off("afterExec",Ue)},value:!1}}),Y.hardWrap=J});ace.define("ace/keyboard/vim",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/dom","ace/lib/oop","ace/lib/keys","ace/lib/event","ace/search","ace/lib/useragent","ace/search_highlight","ace/commands/multi_select_commands","ace/mode/text","ace/ext/hardwrap","ace/multi_select"],function(E,Y,or){"use strict";function We(){var e="";function r(a){return typeof a!="object"?a+"":"line"in a?a.line+":"+a.ch:"anchor"in a?r(a.anchor)+"->"+r(a.head):Array.isArray(a)?"["+a.map(function(o){return r(o)})+"]":JSON.stringify(a)}for(var t=0;t0){u.row+=o,u.column+=u.row==a.row?s:0;continue}!n&&h<=0&&(u.row=i.row,u.column=i.column,h===0&&(u.bias=1))}}};var e=function(t,n,i,a){this.cm=t,this.id=n,this.row=i,this.column=a,t.marks[this.id]=this};e.prototype.clear=function(){delete this.cm.marks[this.id]},e.prototype.find=function(){return T(this)},this.setBookmark=function(t,n){var i=new e(this,this.$uid++,t.line,t.ch);return(!n||!n.insertLeft)&&(i.$insertRight=!0),this.marks[i.id]=i,i},this.moveH=function(t,n){if(n=="char"){var i=this.ace.selection;i.clearSelection(),i.moveCursorBy(0,t)}},this.findPosV=function(t,n,i,a){if(i=="page"){var o=this.ace.renderer,s=o.layerConfig;n=n*Math.floor(s.height/s.lineHeight),i="line"}if(i=="line"){var l=this.ace.session.documentToScreenPosition(t.line,t.ch);a!=null&&(l.column=a),l.row+=n,l.row=Math.min(Math.max(0,l.row),this.ace.session.getScreenLength()-1);var u=this.ace.session.screenToDocumentPosition(l.row,l.column);return T(u)}else debugger},this.charCoords=function(t,n){if(n=="div"||!n){var i=this.ace.session.documentToScreenPosition(t.line,t.ch);return{left:i.column,top:i.row}}if(n=="local"){var a=this.ace.renderer,i=this.ace.session.documentToScreenPosition(t.line,t.ch),o=a.layerConfig.lineHeight,s=a.layerConfig.characterWidth,l=o*i.row;return{left:i.column*s,top:l,bottom:l+o}}},this.coordsChar=function(t,n){var i=this.ace.renderer;if(n=="local"){var a=Math.max(0,Math.floor(t.top/i.lineHeight)),o=Math.max(0,Math.floor(t.left/i.characterWidth)),s=i.session.screenToDocumentPosition(a,o);return T(s)}else if(n=="div")throw"not implemented"},this.getSearchCursor=function(t,n,i){var a=!1,o=!1;t instanceof RegExp&&!t.global&&(a=!t.ignoreCase,t=t.source,o=!0),t=="\\n"&&(t=`
`,o=!1);var s=new Ke;n.ch==null&&(n.ch=Number.MAX_VALUE);var l={row:n.line,column:n.ch},u=this,f=null;return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(h){s.setOptions({needle:t,caseSensitive:a,wrap:!1,backwards:h,regExp:o,start:f||l});var p=s.find(u.ace.session);return f=p,f&&[!f.isEmpty()]},from:function(){return f&&T(f.start)},to:function(){return f&&T(f.end)},replace:function(h){f&&(f.end=u.ace.session.doc.replace(f,h))}}},this.scrollTo=function(t,n){var i=this.ace.renderer,a=i.layerConfig,o=a.maxHeight;o-=(i.$size.scrollerHeight-i.lineHeight)*i.$scrollPastEnd,n!=null&&this.ace.session.setScrollTop(Math.max(0,Math.min(n,o))),t!=null&&this.ace.session.setScrollLeft(Math.max(0,Math.min(t,a.width)))},this.scrollInfo=function(){return 0},this.scrollIntoView=function(t,n){if(t){var i=this.ace.renderer,a={top:0,bottom:n};i.scrollCursorIntoView(q(t),i.lineHeight*2/i.$size.scrollerHeight,a)}},this.getLine=function(t){return this.ace.session.getLine(t)},this.getRange=function(t,n){return this.ace.session.getTextRange(new J(t.line,t.ch,n.line,n.ch))},this.replaceRange=function(t,n,i){i||(i=n);var a=new J(n.line,n.ch,i.line,i.ch);return this.ace.session.$clipRangeToDocument(a),this.ace.session.replace(a,t)},this.replaceSelection=this.replaceSelections=function(t){var n=Array.isArray(t)&&t,i=this.ace.selection;if(this.ace.inVirtualSelectionMode){this.ace.session.replace(i.getRange(),n?t[0]||"":t);return}i.inVirtualSelectionMode=!0;var a=i.rangeList.ranges;a.length||(a=[this.ace.multiSelect.getRange()]);for(var o=a.length;o--;)this.ace.session.replace(a[o],n?t[o]||"":t);i.inVirtualSelectionMode=!1},this.getSelection=function(){return this.ace.getSelectedText()},this.getSelections=function(){return this.listSelections().map(function(t){return this.getRange(t.anchor,t.head)},this)},this.getInputField=function(){return this.ace.textInput.getElement()},this.getWrapperElement=function(){return this.ace.container};var r={indentWithTabs:"useSoftTabs",indentUnit:"tabSize",tabSize:"tabSize",firstLineNumber:"firstLineNumber",readOnly:"readOnly"};this.setOption=function(t,n){switch(this.state[t]=n,t){case"indentWithTabs":t=r[t],n=!n;break;case"keyMap":this.state.$keyMap=n;return;default:t=r[t]}t&&this.ace.setOption(t,n)},this.getOption=function(t){var n,i=r[t];switch(i&&(n=this.ace.getOption(i)),t){case"indentWithTabs":return t=r[t],!n;case"keyMap":return this.state.$keyMap||"vim"}return i?n:this.state[t]},this.toggleOverwrite=function(t){return this.state.overwrite=t,this.ace.setOverwrite(t)},this.addOverlay=function(t){if(!this.$searchHighlight||!this.$searchHighlight.session){var n=new Re(null,"ace_highlight-marker","text"),i=this.ace.session.addDynamicMarker(n);n.id=i.id,n.session=this.ace.session,n.destroy=function(o){n.session.off("change",n.updateOnChange),n.session.off("changeEditor",n.destroy),n.session.removeMarker(n.id),n.session=null},n.updateOnChange=function(o){var s=o.start.row;s==o.end.row?n.cache[s]=void 0:n.cache.splice(s,n.cache.length)},n.session.on("changeEditor",n.destroy),n.session.on("change",n.updateOnChange)}var a=new RegExp(t.query.source,"gmi");this.$searchHighlight=t.highlight=n,this.$searchHighlight.setRegexp(a),this.ace.renderer.updateBackMarkers()},this.removeOverlay=function(t){this.$searchHighlight&&this.$searchHighlight.session&&this.$searchHighlight.destroy()},this.getScrollInfo=function(){var t=this.ace.renderer,n=t.layerConfig;return{left:t.scrollLeft,top:t.scrollTop,height:n.maxHeight,width:n.width,clientHeight:n.height,clientWidth:n.width}},this.getValue=function(){return this.ace.getValue()},this.setValue=function(t){return this.ace.setValue(t,-1)},this.getTokenTypeAt=function(t){var n=this.ace.session.getTokenAt(t.line,t.ch);return n&&/comment|string/.test(n.type)?"string":""},this.findMatchingBracket=function(t){var n=this.ace.session.findMatchingBracket(q(t));return{to:n&&T(n)}},this.findMatchingTag=function(t){var n=this.ace.session.getMatchingTags(q(t));if(n)return{open:{from:T(n.openTag.start),to:T(n.openTag.end)},close:{from:T(n.closeTag.start),to:T(n.closeTag.end)}}},this.indentLine=function(t,n){n===!0?this.ace.session.indentRows(t,t," "):n===!1&&this.ace.session.outdentRows(new J(t,0,t,0))},this.indexFromPos=function(t){return this.ace.session.doc.positionToIndex(q(t))},this.posFromIndex=function(t){return T(this.ace.session.doc.indexToPosition(t))},this.focus=function(t){return this.ace.textInput.focus()},this.blur=function(t){return this.ace.blur()},this.defaultTextHeight=function(t){return this.ace.renderer.layerConfig.lineHeight},this.scanForBracket=function(t,n,i,a){var o=a.bracketRegex.source,s=/paren|text|operator|tag/;if(n==1)var l=this.ace.session.$findClosingBracket(o.slice(1,2),q(t),s);else{var l=this.ace.session.$findOpeningBracket(o.slice(-2,-1),{row:t.line,column:t.ch+1},s);!l&&a.bracketRegex&&a.bracketRegex.test(this.getLine(t.line)[t.ch-1])&&(l={row:t.line,column:t.ch-1})}return l&&{pos:T(l)}},this.refresh=function(){return this.ace.resize(!0)},this.getMode=function(){return{name:this.getOption("mode")}},this.execCommand=function(t){if(y.commands.hasOwnProperty(t))return y.commands[t](this);if(t=="indentAuto")return this.ace.execCommand("autoindent");console.log(t+" is not implemented")},this.getLineNumber=function(t){var n=this.$lineHandleChanges;if(!n)return null;for(var i=t.row,a=0;a0)return null;i-=o.end.row-o.start.row}}}return i},this.getLineHandle=function(t){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{text:this.ace.session.getLine(t),row:t}},this.releaseLineHandles=function(){this.$lineHandleChanges=void 0},this.getLastEditEnd=function(){var t=this.ace.session.$undoManager;if(t&&t.$lastDelta)return T(t.$lastDelta.end)}}.call(y.prototype);function q(e){return{row:e.line,column:e.ch}}function T(e){return new g(e.row,e.column)}var je=y.StringStream=function(e,r){this.pos=this.start=0,this.string=e,this.tabSize=r||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};je.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.posr},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var r=this.string.indexOf(e,this.pos);if(r>-1)return this.pos=r,!0},backUp:function(e){this.pos-=e},column:function(){throw"not implemented"},indentation:function(){throw"not implemented"},match:function(e,r,t){if(typeof e=="string"){var n=function(o){return t?o.toLowerCase():o},i=this.string.substr(this.pos,e.length);if(n(i)==n(e))return r!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&r!==!1&&(this.pos+=a[0].length),a)}},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,r){this.lineStart+=e;try{return r()}finally{this.lineStart-=e}}},y.defineExtension=function(e,r){y.prototype[e]=r},Te.importCssString(`.normal-mode .ace_cursor{
border: none;
background-color: rgba(255,0,0,0.5);
}
.normal-mode .ace_hidden-cursors .ace_cursor{
background-color: transparent;
border: 1px solid red;
opacity: 0.7
}
.ace_dialog {
position: absolute;
left: 0; right: 0;
background: inherit;
z-index: 15;
padding: .1em .8em;
overflow: hidden;
color: inherit;
}
.ace_dialog-top {
border-bottom: 1px solid #444;
top: 0;
}
.ace_dialog-bottom {
border-top: 1px solid #444;
bottom: 0;
}
.ace_dialog input {
border: none;
outline: none;
background: transparent;
width: 20em;
color: inherit;
font-family: monospace;
}`,"vimMode",!1),function(){function e(t,n,i){var a=t.ace.container,o;return o=a.appendChild(document.createElement("div")),i?o.className="ace_dialog ace_dialog-bottom":o.className="ace_dialog ace_dialog-top",typeof n=="string"?o.innerHTML=n:o.appendChild(n),o}function r(t,n){t.state.currentNotificationClose&&t.state.currentNotificationClose(),t.state.currentNotificationClose=n}y.defineExtension("openDialog",function(t,n,i){if(this.virtualSelectionMode())return;i||(i={}),r(this,null);var a=e(this,t,i.bottom),o=!1,s=this;this.state.dialog=a;function l(h){if(typeof h=="string")u.value=h;else{if(o||h&&h.type=="blur"&&document.activeElement===u)return;s.state.dialog==a&&(s.state.dialog=null,s.focus()),o=!0,a.remove(),i.onClose&&i.onClose(a);var p=s;p.state.vim&&(p.state.vim.status=null,p.ace._signal("changeStatus"),p.ace.renderer.$loop.schedule(p.ace.renderer.CHANGE_CURSOR))}}var u=a.getElementsByTagName("input")[0],f;return u?(i.value&&(u.value=i.value,i.selectValueOnOpen!==!1&&u.select()),i.onInput&&y.on(u,"input",function(h){i.onInput(h,u.value,l)}),i.onKeyUp&&y.on(u,"keyup",function(h){i.onKeyUp(h,u.value,l)}),y.on(u,"keydown",function(h){i&&i.onKeyDown&&i.onKeyDown(h,u.value,l)||(h.keyCode==13&&n(u.value),(h.keyCode==27||i.closeOnEnter!==!1&&h.keyCode==13)&&(y.e_stop(h),l()))}),i.closeOnBlur!==!1&&y.on(u,"blur",l),u.focus()):(f=a.getElementsByTagName("button")[0])&&(y.on(f,"click",function(){l(),s.focus()}),i.closeOnBlur!==!1&&y.on(f,"blur",l),f.focus()),l}),y.defineExtension("openNotification",function(t,n){if(this.virtualSelectionMode())return;r(this,l);var i=e(this,t,n&&n.bottom),a=!1,o,s=n&&typeof n.duration<"u"?n.duration:5e3;function l(){a||(a=!0,clearTimeout(o),i.remove())}return y.on(i,"click",function(u){y.e_preventDefault(u),l()}),s&&(o=setTimeout(l,s)),l})}();var g=y.Pos;function ge(e,r,t){if(r.line===t.line&&r.ch>=t.ch-1){var n=e.getLine(r.line),i=n.charCodeAt(r.ch);55296<=i&&i<=55551&&(t.ch+=1)}return{start:r,end:t}}var I=[{keys:"",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"g",type:"keyToKey",toKeys:"gk"},{keys:"g",type:"keyToKey",toKeys:"gj"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"x"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"idle",context:"normal"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:'"',type:"action",action:"setRegister"},{keys:"",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],Se=I.length,re=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],Q=St("");function Qe(e){e.setOption("disableInput",!0),e.setOption("showCursorWhenSelecting",!1),y.signal(e,"vim-mode-change",{mode:"normal"}),e.on("cursorActivity",Zt),Ne(e),y.on(e.getInputField(),"paste",ue(e))}function Je(e){e.setOption("disableInput",!1),e.off("cursorActivity",Zt),y.off(e.getInputField(),"paste",ue(e)),e.state.vim=null,Ve&&clearTimeout(Ve)}function ue(e){var r=e.state.vim;return r.onPasteFn||(r.onPasteFn=function(){r.insertMode||(e.setCursor(N(e.getCursor(),0,1)),de.enterInsertMode(e,{},r))}),r.onPasteFn}var ne=/[\d]/,G=[y.isWordChar,function(e){return e&&!y.isWordChar(e)&&!/\s/.test(e)}],xe=[function(e){return/\S/.test(e)}],sr=["<",">"],yt=["-",'"',".",":","_","/","+"],Ct=/^\w$/,qe;try{qe=new RegExp("^[\\p{Lu}]$","u")}catch{qe=/^[A-Z]$/}function et(e,r){return r>=e.firstLine()&&r<=e.lastLine()}function tt(e){return/^[a-z]$/.test(e)}function lr(e){return"()[]{}".indexOf(e)!=-1}function ur(e){return ne.test(e)}function ze(e){return qe.test(e)}function X(e){return/^\s*$/.test(e)}function Oe(e){return".?!".indexOf(e)!=-1}function rt(e,r){for(var t=0;t1&&r.setOption("textwidth",n)}});var fr=function(){var e=100,r=-1,t=0,n=0,i=new Array(e);function a(l,u,f){var h=r%e,p=i[h];function d(C){var v=++r%e,w=i[v];w&&w.clear(),i[v]=l.setBookmark(C)}if(p){var c=p.find();c&&!ee(c,u)&&d(u)}else d(u);d(f),t=r,n=r-e+1,n<0&&(n=0)}function o(l,u){r+=u,r>t?r=t:r0?1:-1,p,d=l.getCursor();do if(r+=h,f=i[(e+r)%e],f&&(p=f.find())&&!ee(d,p))break;while(rn)}return f}function s(l,u){var f=r,h=o(l,u);return r=f,h&&h.find()}return{cachedCursor:void 0,add:a,find:s,move:o}},wt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};function mt(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=wt()}mt.prototype={exitMacroRecordMode:function(){var e=m.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,r){var t=m.registerController.getRegister(r);if(t){if(t.clear(),this.latestRegister=r,e.openDialog){var n=we("span",{class:"cm-vim-message"},"recording @"+r);this.onRecordingDone=e.openDialog(n,null,{bottom:!0})}this.isRecording=!0}}};function Ne(e){return e.state.vim||(e.state.vim={inputState:new Ge,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{},expectLiteralNext:!1}),e.state.vim}var m;function kt(){m={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:fr(),macroModeState:new mt,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new xt({}),searchHistoryController:new at,exCommandHistoryController:new at};for(var e in ce){var r=ce[e];r.value=r.defaultValue}}var Pe,B={enterVimMode:Qe,leaveVimMode:Je,buildKeyMap:function(){},getRegisterController:function(){return m.registerController},resetVimGlobalState_:kt,getVimGlobalState_:function(){return m},maybeInitVimState_:Ne,suppressErrorLogging:!1,InsertModeKey:dt,map:function(e,r,t){oe.map(e,r,t)},unmap:function(e,r){return oe.unmap(e,r)},noremap:function(e,r,t){oe.map(e,r,t,!0)},mapclear:function(e){var r=I.length,t=Se,n=I.slice(0,r-t);if(I=I.slice(r-t),e)for(var i=n.length-1;i>=0;i--){var a=n[i];if(e!==a.context)if(a.context)this._mapCommand(a);else{var o=["normal","insert","visual"];for(var s in o)if(o[s]!==e){var l={};for(var u in a)l[u]=a[u];l.context=o[s],this._mapCommand(l)}}}},langmap:Mt,vimKeyFromEvent:De,setOption:nt,getOption:ye,defineOption:be,defineEx:function(e,r,t){if(!r)r=e;else if(e.indexOf(r)!==0)throw new Error('(Vim.defineEx) "'+r+'" is not a prefix of "'+e+'", command not registered');zt[e]=t,oe.commandMap_[r]={name:e,shortName:r,type:"api"}},handleKey:function(e,r,t){var n=this.findKey(e,r,t);if(typeof n=="function")return n()},multiSelectHandleKey:ir,findKey:function(e,r,t){var n=Ne(e);function i(){var u=m.macroModeState;if(u.isRecording){if(r=="q")return u.exitMacroRecordMode(),F(e),!0;t!="mapping"&&Zr(u,r)}}function a(){if(r==""){if(n.visualMode)ae(e);else if(n.insertMode)me(e);else return;return F(e),!0}}function o(){if(a())return!0;n.inputState.keyBuffer.push(r);var u=n.inputState.keyBuffer.join(""),f=r.length==1,h=Le.matchCommand(u,I,n.inputState,"insert"),p=n.inputState.changeQueue;if(h.type=="none")return F(e),!1;if(h.type=="partial"){if(h.expectLiteralNext&&(n.expectLiteralNext=!0),Pe&&window.clearTimeout(Pe),Pe=f&&window.setTimeout(function(){n.insertMode&&n.inputState.keyBuffer.length&&F(e)},ye("insertModeEscKeysTimeout")),f){var d=e.listSelections();(!p||p.removed.length!=d.length)&&(p=n.inputState.changeQueue=new dr),p.inserted+=r;for(var c=0;c|./gi,o;o=a.exec(r);){var s=o[0],l=i.insertMode;if(K){cr(s);continue}var u=B.handleKey(e,s,"mapping");if(!u&&l&&i.insertMode){if(s[0]=="<"){var f=s.toLowerCase().slice(1,-1),h=f.split("-");if(f=h.pop()||"",f=="lt")s="<";else if(f=="space")s=" ";else if(f=="cr")s=`
`;else if(Ie.hasOwnProperty(f)){s=Ie[f],tr(e,s);continue}else s=s[0],a.lastIndex=o.index+1}e.replaceSelection(s)}}}finally{if(Ee.pop(),He=Ee.length?n:!1,!Ee.length&&K){var p=K;K=null,$e(e,p)}}}var it={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},hr={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},Ie={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(it)).forEach(function(e){Ie[(it[e]||"").toLowerCase()]=Ie[e.toLowerCase()]=e});function De(e,r){var t=e.key;if(!hr[t]){t.length>1&&t[0]=="n"&&(t=t.replace("Numpad","")),t=it[t]||t;var n="";if(e.ctrlKey&&(n+="C-"),e.altKey&&(n+="A-"),e.metaKey&&(n+="M-"),y.isMac&&e.altKey&&!e.metaKey&&!e.ctrlKey&&(n=n.slice(2)),(n||t.length>1)&&e.shiftKey&&(n+="S-"),r&&!r.expectLiteralNext&&t.length==1){if(Q.keymap&&t in Q.keymap)(Q.remapCtrl!=!1||!n)&&(t=Q.keymap[t]);else if(t.charCodeAt(0)>255){var i=e.code&&e.code.slice(-1)||"";e.shiftKey||(i=i.toLowerCase()),i&&(t=i)}}return n+=t,n.length>1&&(n="<"+n+">"),n}}function Mt(e,r){Q.string!==e&&(Q=St(e)),Q.remapCtrl=r}function St(e){var r={};if(!e)return{keymap:r,string:""};function t(n){return n.split(/\\?(.)/).filter(Boolean)}return e.split(/((?:[^\\,]|\\.)+),/).map(function(n){if(n){var i=n.split(/((?:[^\\;]|\\.)+);/);if(i.length==3){var a=t(i[1]),o=t(i[2]);if(a.length!==o.length)return;for(var s=0;s0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e};function F(e,r){e.state.vim.inputState=new Ge,e.state.vim.expectLiteralNext=!1,y.signal(e,"vim-command-done",r)}function dr(){this.removed=[],this.inserted=""}function ie(e,r,t){this.clear(),this.keyBuffer=[e||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!r,this.blockwise=!!t}ie.prototype={setText:function(e,r,t){this.keyBuffer=[e||""],this.linewise=!!r,this.blockwise=!!t},pushText:function(e,r){r&&(this.linewise||this.keyBuffer.push(`
`),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(wt(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}};function pr(e,r){var t=m.registerController.registers;if(!e||e.length!=1)throw Error("Register name must be 1 character");t[e]=r,yt.push(e)}function xt(e){this.registers=e,this.unnamedRegister=e['"']=new ie,e["."]=new ie,e[":"]=new ie,e["/"]=new ie,e["+"]=new ie}xt.prototype={pushText:function(e,r,t,n,i){if(e!=="_"){n&&t.charAt(t.length-1)!==`
`&&(t+=`
`);var a=this.isValidRegister(e)?this.getRegister(e):null;if(!a){switch(r){case"yank":this.registers[0]=new ie(t,n,i);break;case"delete":case"change":t.indexOf(`
`)==-1?this.registers["-"]=new ie(t,n):(this.shiftNumericRegisters_(),this.registers[1]=new ie(t,n));break}this.unnamedRegister.setText(t,n,i);return}var o=ze(e);o?a.pushText(t,n):a.setText(t,n,i),e==="+"&&typeof navigator<"u"&&typeof navigator.clipboard<"u"&&typeof navigator.clipboard.readText=="function"&&navigator.clipboard.writeText(t),this.unnamedRegister.setText(a.toString(),n)}},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new ie),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&(rt(e,yt)||Ct.test(e))},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}};function at(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}at.prototype={nextMatch:function(e,r){var t=this.historyBuffer,n=r?-1:1;this.initialPrefix===null&&(this.initialPrefix=e);for(var i=this.iterator+n;r?i>=0:i=t.length)return this.iterator=t.length,this.initialPrefix;if(i<0)return e},pushInput:function(e){var r=this.historyBuffer.indexOf(e);r>-1&&this.historyBuffer.splice(r,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var Le={matchCommand:function(e,r,t,n){var i=Cr(e,r,n,t);if(!i.full&&!i.partial)return{type:"none"};if(!i.full&&i.partial)return{type:"partial",expectLiteralNext:i.partial.length==1&&i.partial[0].keys.slice(-11)==""};for(var a,o=0;o"||a.keys.slice(-10)==""){var l=mr(e);if(!l||l.length>1)return{type:"clear"};t.selectedCharacter=l}return{type:"full",command:a}},processCommand:function(e,r,t){switch(r.inputState.repeatOverride=t.repeatOverride,t.type){case"motion":this.processMotion(e,r,t);break;case"operator":this.processOperator(e,r,t);break;case"operatorMotion":this.processOperatorMotion(e,r,t);break;case"action":this.processAction(e,r,t);break;case"search":this.processSearch(e,r,t);break;case"ex":case"keyToEx":this.processEx(e,r,t);break;default:break}},processMotion:function(e,r,t){r.inputState.motion=t.motion,r.inputState.motionArgs=Xe(t.motionArgs),this.evalInput(e,r)},processOperator:function(e,r,t){var n=r.inputState;if(n.operator)if(n.operator==t.operator){n.motion="expandToLine",n.motionArgs={linewise:!0},this.evalInput(e,r);return}else F(e);n.operator=t.operator,n.operatorArgs=Xe(t.operatorArgs),t.keys.length>1&&(n.operatorShortcut=t.keys),t.exitVisualBlock&&(r.visualBlock=!1,Be(e)),r.visualMode&&this.evalInput(e,r)},processOperatorMotion:function(e,r,t){var n=r.visualMode,i=Xe(t.operatorMotionArgs);i&&n&&i.visualLine&&(r.visualLine=!0),this.processOperator(e,r,t),n||this.processMotion(e,r,t)},processAction:function(e,r,t){var n=r.inputState,i=n.getRepeat(),a=!!i,o=Xe(t.actionArgs)||{};n.selectedCharacter&&(o.selectedCharacter=n.selectedCharacter),t.operator&&this.processOperator(e,r,t),t.motion&&this.processMotion(e,r,t),(t.motion||t.operator)&&this.evalInput(e,r),o.repeat=i||1,o.repeatIsExplicit=a,o.registerName=n.registerName,F(e),r.lastMotion=null,t.isEdit&&this.recordLastEdit(r,n,t),de[t.action](e,o,r)},processSearch:function(e,r,t){if(!e.getSearchCursor)return;var n=t.searchArgs.forward,i=t.searchArgs.wholeWordOnly;te(e).setReversed(!n);var a=n?"/":"?",o=te(e).getQuery(),s=e.getScrollInfo();function l(v,w,M){m.searchHistoryController.pushInput(v),m.searchHistoryController.reset();try{Fe(e,v,w,M)}catch{b(e,"Invalid regex: "+v),F(e);return}Le.processMotion(e,r,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:t.searchArgs.toJumplist}})}function u(v){l(v,!0,!0);var w=m.macroModeState;w.isRecording&&qr(w,v)}function f(v,w,M){var k=De(v),L,_;k==""||k==""?(L=k=="",_=v.target?v.target.selectionEnd:0,w=m.searchHistoryController.nextMatch(w,L)||"",M(w),_&&v.target&&(v.target.selectionEnd=v.target.selectionStart=Math.min(_,v.target.value.length))):k&&k!=""&&k!=""&&m.searchHistoryController.reset();var O;try{O=Fe(e,w,!0,!0)}catch{}O?e.scrollIntoView(jt(e,!n,O),30):(ct(e),e.scrollTo(s.left,s.top))}function h(v,w,M){var k=De(v);k==""||k==""||k==""||k==""&&w==""?(m.searchHistoryController.pushInput(w),m.searchHistoryController.reset(),Fe(e,o),ct(e),e.scrollTo(s.left,s.top),y.e_stop(v),F(e),M(),e.focus()):k==""||k==""?y.e_stop(v):k==""&&(y.e_stop(v),M(""))}switch(t.searchArgs.querySrc){case"prompt":var p=m.macroModeState;if(p.isPlaying){var C=p.replaySearchQueries.shift();l(C,!0,!1)}else $e(e,{onClose:u,prefix:a,desc:"(JavaScript regexp)",onKeyUp:f,onKeyDown:h});break;case"wordUnderCursor":var d=ut(e,{noSymbol:!0}),c=!0;if(d||(d=ut(e,{noSymbol:!1}),c=!1),!d){b(e,"No word under cursor"),F(e);return}var C=e.getLine(d.start.line).substring(d.start.ch,d.end.ch);c&&i?C="\\b"+C+"\\b":C=kr(C),m.jumpList.cachedCursor=e.getCursor(),e.setCursor(d.start),l(C,!0,!1);break}},processEx:function(e,r,t){function n(a){m.exCommandHistoryController.pushInput(a),m.exCommandHistoryController.reset(),oe.processCommand(e,a),e.state.vim&&F(e)}function i(a,o,s){var l=De(a),u,f;(l==""||l==""||l==""||l==""&&o=="")&&(m.exCommandHistoryController.pushInput(o),m.exCommandHistoryController.reset(),y.e_stop(a),F(e),s(),e.focus()),l==""||l==""?(y.e_stop(a),u=l=="",f=a.target?a.target.selectionEnd:0,o=m.exCommandHistoryController.nextMatch(o,u)||"",s(o),f&&a.target&&(a.target.selectionEnd=a.target.selectionStart=Math.min(f,a.target.value.length))):l==""?(y.e_stop(a),s("")):l&&l!=""&&l!=""&&m.exCommandHistoryController.reset()}t.type=="keyToEx"?oe.processCommand(e,t.exArgs.input):r.visualMode?$e(e,{onClose:n,prefix:":",value:"'<,'>",onKeyDown:i,selectValueOnOpen:!1}):$e(e,{onClose:n,prefix:":",onKeyDown:i})},evalInput:function(e,r){var t=r.inputState,n=t.motion,i=t.motionArgs||{},a=t.operator,o=t.operatorArgs||{},s=t.registerName,l=r.sel,u=A(r.visualMode?W(e,l.head):e.getCursor("head")),f=A(r.visualMode?W(e,l.anchor):e.getCursor("anchor")),h=A(u),p=A(f),d,c,C;if(a&&this.recordLastEdit(r,t),t.repeatOverride!==void 0?C=t.repeatOverride:C=t.getRepeat(),C>0&&i.explicitRepeat?i.repeatIsExplicit=!0:(i.noRepeat||!i.explicitRepeat&&C===0)&&(C=1,i.repeatIsExplicit=!1),t.selectedCharacter&&(i.selectedCharacter=o.selectedCharacter=t.selectedCharacter),i.repeat=C,F(e),n){var v=he[n](e,u,i,r,t);if(r.lastMotion=he[n],!v)return;if(i.toJumplist){!a&&e.ace.curOp!=null&&(e.ace.curOp.command.scrollIntoView="center-animate");var w=m.jumpList,M=w.cachedCursor;M?(Et(e,M,v),delete w.cachedCursor):Et(e,u,v)}v instanceof Array?(c=v[0],d=v[1]):d=v,d||(d=A(u)),r.visualMode?(r.visualBlock&&d.ch===1/0||(d=W(e,d,h)),c&&(c=W(e,c)),c=c||p,l.anchor=c,l.head=d,Be(e),pe(e,r,"<",R(c,d)?c:d),pe(e,r,">",R(c,d)?d:c)):a||(e.ace.curOp&&(e.ace.curOp.vimDialogScroll="center-animate"),d=W(e,d,h),e.setCursor(d.line,d.ch))}if(a){if(o.lastSel){c=p;var k=o.lastSel,L=Math.abs(k.head.line-k.anchor.line),_=Math.abs(k.head.ch-k.anchor.ch);k.visualLine?d=new g(p.line+L,p.ch):k.visualBlock?d=new g(p.line+L,p.ch+_):k.head.line==k.anchor.line?d=new g(p.line,p.ch+_):d=new g(p.line+L,p.ch),r.visualMode=!0,r.visualLine=k.visualLine,r.visualBlock=k.visualBlock,l=r.sel={anchor:c,head:d},Be(e)}else r.visualMode&&(o.lastSel={anchor:A(l.anchor),head:A(l.head),visualBlock:r.visualBlock,visualLine:r.visualLine});var O,D,S,x,U;if(r.visualMode){O=Z(l.head,l.anchor),D=Ce(l.head,l.anchor),S=r.visualLine||o.linewise,x=r.visualBlock?"block":S?"line":"char";var P=ge(e,O,D);if(U=lt(e,{anchor:P.start,head:P.end},x),S){var H=U.ranges;if(x=="block")for(var ke=0;keu&&i.line==u)return Nt(e,r,t,n,!0);var f=e.ace.session.getFoldLine(s);return f&&(t.forward?s>f.start.row&&(s=f.end.row+1):s=f.start.row),t.toFirstChar&&(a=fe(e.getLine(s)),n.lastHPos=a),n.lastHSPos=e.charCoords(new g(s,a),"div").left,new g(s,a)},moveByDisplayLines:function(e,r,t,n){var i=r;switch(n.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:n.lastHSPos=e.charCoords(i,"div").left}var a=t.repeat,o=e.findPosV(i,t.forward?a:-a,"line",n.lastHSPos);if(o.hitSide)if(t.forward)var s=e.charCoords(o,"div"),l={top:s.top+8,left:n.lastHSPos},o=e.coordsChar(l,"div");else{var u=e.charCoords(new g(e.firstLine(),0),"div");u.left=n.lastHSPos,o=e.coordsChar(u,"div")}return n.lastHPos=o.ch,o},moveByPage:function(e,r,t){var n=r,i=t.repeat;return e.findPosV(n,t.forward?i:-i,"page")},moveByParagraph:function(e,r,t){var n=t.forward?1:-1;return Pt(e,r,t.repeat,n)},moveBySentence:function(e,r,t){var n=t.forward?1:-1;return Nr(e,r,t.repeat,n)},moveByScroll:function(e,r,t,n){var i=e.getScrollInfo(),a=null,o=t.repeat;o||(o=i.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(r,"local");if(t.repeat=o,a=he.moveByDisplayLines(e,r,t,n),!a)return null;var l=e.charCoords(a,"local");return e.scrollTo(null,i.top+l.top-s.top),a},moveByWords:function(e,r,t){return Ir(e,r,t.repeat,!!t.forward,!!t.wordEnd,!!t.bigWord)},moveTillCharacter:function(e,r,t){var n=t.repeat,i=ft(e,n,t.forward,t.selectedCharacter,r),a=t.forward?-1:1;return It(a,t),i?(i.ch+=a,i):null},moveToCharacter:function(e,r,t){var n=t.repeat;return It(0,t),ft(e,n,t.forward,t.selectedCharacter,r)||r},moveToSymbol:function(e,r,t){var n=t.repeat;return Er(e,n,t.forward,t.selectedCharacter)||r},moveToColumn:function(e,r,t,n){var i=t.repeat;return n.lastHPos=i-1,n.lastHSPos=e.charCoords(r,"div").left,Br(e,i)},moveToEol:function(e,r,t,n){return Nt(e,r,t,n,!1)},moveToFirstNonWhiteSpaceCharacter:function(e,r){var t=r;return new g(t.line,fe(e.getLine(t.line)))},moveToMatchedSymbol:function(e,r){for(var t=r,n=t.line,i=t.ch,a=e.getLine(n),o;i]/.test(a[i])?/[(){}[\]<>]/:/[(){}[\]]/,u=e.findMatchingBracket(new g(n,i+1),{bracketRegex:l});return u.to}else return t},moveToStartOfLine:function(e,r){return new g(r.line,0)},moveToLineOrEdgeOfDocument:function(e,r,t){var n=t.forward?e.lastLine():e.firstLine();return t.repeatIsExplicit&&(n=t.repeat-e.getOption("firstLineNumber")),new g(n,fe(e.getLine(n)))},moveToStartOfDisplayLine:function(e){return e.execCommand("goLineLeft"),e.getCursor()},moveToEndOfDisplayLine:function(e){e.execCommand("goLineRight");var r=e.getCursor();return r.sticky=="before"&&r.ch--,r},textObjectManipulation:function(e,r,t,n){var i={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},a={"'":!0,'"':!0,"`":!0},o=t.selectedCharacter;o=="b"?o="(":o=="B"&&(o="{");var s=!t.textObjectInner,l,u;if(i[o]){if(u=!0,l=_t(e,r,o,s),!l){var f=e.getSearchCursor(new RegExp("\\"+o,"g"),r);f.find()&&(l=_t(e,f.from(),o,s))}}else if(a[o])u=!0,l=Pr(e,r,o,s);else if(o==="W"||o==="w")for(var h=t.repeat||1;h-- >0;){var p=ut(e,{inclusive:s,innerWord:!s,bigWord:o==="W",noSymbol:o==="W",multiline:!0},l&&l.end);p&&(l||(l=p),l.end=p.end)}else if(o==="p")if(l=Pt(e,r,t.repeat,0,s),t.linewise=!0,n.visualMode)n.visualLine||(n.visualLine=!0);else{var d=n.inputState.operatorArgs;d&&(d.linewise=!0),l.end.line--}else if(o==="t")l=Rr(e,r,s);else if(o==="s"){var c=e.getLine(r.line);r.ch>0&&Oe(c[r.ch])&&(r.ch-=1);var C=Ht(e,r,t.repeat,1,s),v=Ht(e,r,t.repeat,-1,s);X(e.getLine(v.line)[v.ch])&&X(e.getLine(C.line)[C.ch-1])&&(v={line:v.line,ch:v.ch+1}),l={start:v,end:C}}return l?e.state.vim.visualMode?br(e,l.start,l.end,u):[l.start,l.end]:null},repeatLastCharacterSearch:function(e,r,t){var n=m.lastCharacterSearch,i=t.repeat,a=t.forward===n.forward,o=(n.increment?1:0)*(a?-1:1);e.moveH(-o,"char"),t.inclusive=!!a;var s=ft(e,i,a,n.selectedCharacter);return s?(s.ch+=o,s):(e.moveH(o,"char"),r)}};function vr(e,r){he[e]=r}function bt(e,r){for(var t=[],n=0;no.line&&(s=new g(s.line-1,Number.MAX_VALUE))),e.replaceRange("",o,s),n=o}m.registerController.pushText(r.registerName,"change",i,r.linewise,t.length>1),de.enterInsertMode(e,{head:n},e.state.vim)},delete:function(e,r,t){var n,i,a=e.state.vim;if(a.visualBlock){i=e.getSelection();var l=bt("",t.length);e.replaceSelections(l),n=Z(t[0].head,t[0].anchor)}else{var o=t[0].anchor,s=t[0].head;r.linewise&&s.line!=e.firstLine()&&o.line==e.lastLine()&&o.line==s.line-1&&(o.line==e.firstLine()?o.ch=0:o=new g(o.line-1,$(e,o.line-1))),i=e.getRange(o,s),e.replaceRange("",o,s),n=o,r.linewise&&(n=he.moveToFirstNonWhiteSpaceCharacter(e,o))}return m.registerController.pushText(r.registerName,"delete",i,r.linewise,a.visualBlock),W(e,n)},indent:function(e,r,t){var n=e.state.vim;if(e.indentMore)for(var i=n.visualMode?r.repeat:1,a=0;aa&&r.linewise&&s--,r.keepCursor?n:new g(s,0)}},changeCase:function(e,r,t,n,i){for(var a=e.getSelections(),o=[],s=r.toLower,l=0;lu.top?(l.line+=(s-u.top)/i,l.line=Math.ceil(l.line),e.setCursor(l),u=e.charCoords(l,"local"),e.scrollTo(null,u.top)):e.scrollTo(null,s);else{var f=s+e.getScrollInfo().clientHeight;f=i.anchor.line?a=N(i.head,0,1):a=new g(i.anchor.line,0)}else if(n=="inplace"){if(t.visualMode)return}else n=="lastEdit"&&(a=Qt(e)||a);e.setOption("disableInput",!1),r&&r.replace?(e.toggleOverwrite(!0),e.setOption("keyMap","vim-replace"),y.signal(e,"vim-mode-change",{mode:"replace"})):(e.toggleOverwrite(!1),e.setOption("keyMap","vim-insert"),y.signal(e,"vim-mode-change",{mode:"insert"})),m.macroModeState.isPlaying||(e.on("change",Xt),t.insertEnd&&t.insertEnd.clear(),t.insertEnd=e.setBookmark(a,{insertLeft:!0}),y.on(e.getInputField(),"keydown",qt)),t.visualMode&&ae(e),Rt(e,a,o)}},toggleVisualMode:function(e,r,t){var n=r.repeat,i=e.getCursor(),a;if(t.visualMode)t.visualLine^r.linewise||t.visualBlock^r.blockwise?(t.visualLine=!!r.linewise,t.visualBlock=!!r.blockwise,y.signal(e,"vim-mode-change",{mode:"visual",subMode:t.visualLine?"linewise":t.visualBlock?"blockwise":""}),Be(e)):ae(e);else{t.visualMode=!0,t.visualLine=!!r.linewise,t.visualBlock=!!r.blockwise,a=W(e,new g(i.line,i.ch+n-1));var o=ge(e,i,a);t.sel={anchor:o.start,head:o.end},y.signal(e,"vim-mode-change",{mode:"visual",subMode:t.visualLine?"linewise":t.visualBlock?"blockwise":""}),Be(e),pe(e,t,"<",Z(i,a)),pe(e,t,">",Ce(i,a))}},reselectLastSelection:function(e,r,t){var n=t.lastSelection;if(t.visualMode&&Ot(e,t),n){var i=n.anchorMark.find(),a=n.headMark.find();if(!i||!a)return;t.sel={anchor:i,head:a},t.visualMode=!0,t.visualLine=n.visualLine,t.visualBlock=n.visualBlock,Be(e),pe(e,t,"<",Z(i,a)),pe(e,t,">",Ce(i,a)),y.signal(e,"vim-mode-change",{mode:"visual",subMode:t.visualLine?"linewise":t.visualBlock?"blockwise":""})}},joinLines:function(e,r,t){var n,i;if(t.visualMode){if(n=e.getCursor("anchor"),i=e.getCursor("head"),R(i,n)){var a=i;i=n,n=a}i.ch=$(e,i.line)-1}else{var o=Math.max(r.repeat,2);n=e.getCursor(),i=W(e,new g(n.line+o-1,1/0))}for(var s=0,l=n.line;l1)var n=Array(r.repeat+1).join(n);var d=i.linewise,c=i.blockwise;if(c){n=n.split(`
`),d&&n.pop();for(var C=0;Ce.lastLine()&&e.replaceRange(`
`,new g(S,0));var x=$(e,S);xl.length&&(a=l.length),o=new g(i.line,a)}var u=ge(e,i,o);if(i=u.start,o=u.end,n==`
`)t.visualMode||e.replaceRange("",i,o),(y.commands.newlineAndIndentContinueComment||y.commands.newlineAndIndent)(e);else{var f=e.getRange(i,o);if(f=f.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,n),f=f.replace(/[^\n]/g,n),t.visualBlock){var h=new Array(e.getOption("tabSize")+1).join(" ");f=e.getSelection(),f=f.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,n),f=f.replace(/\t/g,h).replace(/[^\n]/g,n).split(`
`),e.replaceSelections(f)}else e.replaceRange(f,i,o);t.visualMode?(i=R(s[0].anchor,s[0].head)?s[0].anchor:s[0].head,e.setCursor(i),ae(e,!1)):e.setCursor(N(o,0,-1))}},incrementNumberToken:function(e,r){for(var t=e.getCursor(),n=e.getLine(t.line),i=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,a,o,s,l;(a=i.exec(n))!==null&&(o=a.index,s=o+a[0].length,!(t.chl&&(f=-1),l+=f,l>s&&(l-=2)}return new g(a,l)}function Xe(e){var r={};for(var t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}function N(e,r,t){return typeof r=="object"&&(t=r.ch,r=r.line),new g(e.line+r,e.ch+t)}function Cr(e,r,t,n){n.operator&&(t="operatorPending");for(var i,a=[],o=[],s=He?r.length-Se:0,l=s;l",n=r.slice(-10)=="";if(t||n){var i=r.length-(t?11:10),a=e.slice(0,i),o=r.slice(0,i);return a==o&&e.length>i?"full":o.indexOf(a)==0?"partial":!1}else return e==r?"full":r.indexOf(e)==0?"partial":!1}function mr(e){var r=/^.*(<[^>]+>)$/.exec(e),t=r?r[1]:e.slice(-1);if(t.length>1)switch(t){case"":t=`
`;break;case"":t=" ";break;default:t="";break}return t}function Lt(e,r,t){return function(){for(var n=0;n2&&(r=Z.apply(void 0,Array.prototype.slice.call(arguments,1))),R(e,r)?e:r}function Ce(e,r){return arguments.length>2&&(r=Ce.apply(void 0,Array.prototype.slice.call(arguments,1))),R(e,r)?r:e}function At(e,r,t){var n=R(e,r),i=R(r,t);return n&&i}function $(e,r){return e.getLine(r).length}function st(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function kr(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Mr(e,r,t){var n=$(e,r),i=new Array(t-n+1).join(" ");e.setCursor(new g(r,n)),e.replaceRange(i,e.getCursor())}function Tt(e,r){var t=[],n=e.listSelections(),i=A(e.clipPos(r)),a=!ee(r,i),o=e.getCursor("head"),s=Sr(n,o),l=ee(n[s].head,n[s].anchor),u=n.length-1,f=u-s>s?u:0,h=n[f].anchor,p=Math.min(h.line,i.line),d=Math.max(h.line,i.line),c=h.ch,C=i.ch,v=n[f].head.ch-c,w=C-c;v>0&&w<=0?(c++,a||C--):v<0&&w>=0?(c--,l||C++):v<0&&w==-1&&(c--,C++);for(var M=p;M<=d;M++){var k={anchor:new g(M,c),head:new g(M,C)};t.push(k)}return e.setSelections(t),r.ch=C,h.ch=c,h}function Rt(e,r,t){for(var n=[],i=0;il&&(i.line=l),i.ch=$(e,i.line)}return{ranges:[{anchor:a,head:i}],primary:0}}else if(t=="block"){var u=Math.min(a.line,i.line),f=a.ch,h=Math.max(a.line,i.line),p=i.ch;f0&&a&&X(a);a=i.pop())t.line--,t.ch=0;a?(t.line--,t.ch=$(e,t.line)):t.ch=0}}function Tr(e,r,t){r.ch=0,t.ch=0,t.line++}function fe(e){if(!e)return 0;var r=e.search(/\S/);return r==-1?e.length:r}function ut(e,r,t){var n=r.inclusive,i=r.innerWord,a=r.bigWord,o=r.noSymbol,s=r.multiline,l=t||Lr(e),u=e.getLine(l.line),f=u,h=l.line,p=h,d=l.ch,c,C=o?G[0]:xe[0];if(i&&/\s/.test(u.charAt(d)))C=function(_){return/\s/.test(_)};else{for(;!C(u.charAt(d));)if(d++,d>=u.length){if(!s)return null;d--,c=Kt(e,l,!0,a,!0);break}a?C=xe[0]:(C=G[0],C(u.charAt(d))||(C=G[1]))}for(var v=d,w=d;C(u.charAt(w))&&w>=0;)w--;if(w++,c)v=c.to,p=c.line,f=e.getLine(p),!f&&v==0&&v++;else for(;C(u.charAt(v))&&v0;)w--;!w&&!k&&(w=L)}}return{start:new g(h,w),end:new g(p,v)}}function Rr(e,r,t){var n=r;if(!y.findMatchingTag||!y.findEnclosingTag)return{start:n,end:n};var i=y.findMatchingTag(e,r)||y.findEnclosingTag(e,r);return!i||!i.open||!i.close?{start:n,end:n}:t?{start:i.open.from,end:i.close.to}:{start:i.open.to,end:i.close.from}}function Et(e,r,t){ee(r,t)||m.jumpList.add(e,r,t)}function It(e,r){m.lastCharacterSearch.increment=e,m.lastCharacterSearch.forward=r.forward,m.lastCharacterSearch.selectedCharacter=r.selectedCharacter}var Or={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Bt={bracket:{isComplete:function(e){if(e.nextCh===e.symb){if(e.depth++,e.depth>=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return e.index===0&&e.nextCh===e.symb}},comment:{isComplete:function(e){var r=e.lastCh==="*"&&e.nextCh==="/";return e.lastCh=e.nextCh,r}},method:{init:function(e){e.symb=e.symb==="m"?"{":"}",e.reverseSymb=e.symb==="{"?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if(e.nextCh==="#"){var r=e.lineText.match(/^#(\w+)/)[1];if(r==="endif"){if(e.forward&&e.depth===0)return!0;e.depth++}else if(r==="if"){if(!e.forward&&e.depth===0)return!0;e.depth--}if(r==="else"&&e.depth===0)return!0}return!1}}};function Er(e,r,t,n){var i=A(e.getCursor()),a=t?1:-1,o=t?e.lineCount():-1,s=i.ch,l=i.line,u=e.getLine(l),f={lineText:u,nextCh:u.charAt(s),lastCh:null,index:s,symb:n,reverseSymb:(t?{")":"(","}":"{"}:{"(":")","{":"}"})[n],forward:t,depth:0,curMoveThrough:!1},h=Or[n];if(!h)return i;var p=Bt[h].init,d=Bt[h].isComplete;for(p&&p(f);l!==o&&r;){if(f.index+=a,f.nextCh=f.lineText.charAt(f.index),!f.nextCh){if(l+=a,f.lineText=e.getLine(l)||"",a>0)f.index=0;else{var c=f.lineText.length;f.index=c>0?c-1:0}f.nextCh=f.lineText.charAt(f.index)}d(f)&&(i.line=l,i.ch=f.index,r--)}return f.nextCh||f.curMoveThrough?new g(l,f.index):i}function Kt(e,r,t,n,i){var a=r.line,o=r.ch,s=e.getLine(a),l=t?1:-1,u=n?xe:G;if(i&&s==""){if(a+=l,s=e.getLine(a),!et(e,a))return null;o=t?0:s.length}for(;;){if(i&&s=="")return{from:0,to:0,line:a};for(var f=l>0?s.length:-1,h=f,p=f;o!=f;){for(var d=!1,c=0;c0?0:s.length}}function Ir(e,r,t,n,i,a){var o=A(r),s=[];(n&&!i||!n&&i)&&t++;for(var l=!(n&&i),u=0;u0?1:-1;var M=e.ace.session.getFoldLine(w);M&&w+n>M.start.row&&w+n0?M.end.row:M.start.row)-w)}if(n){for(;o<=f&&f<=s&&t>0;)d(f),p(f,n)&&t--,f+=n;return new g(f,0)}var c=e.state.vim;if(c.visualLine&&p(a,1,!0)){var C=c.sel.anchor;p(C.line,-1,!0)&&(!i||C.line!=a)&&(a+=1)}var v=h(a);for(f=a;f<=s&&t;f++)p(f,1,!0)&&(!i||h(f)!=v)&&t--;for(u=new g(f,0),f>s&&!v?v=!0:i=!1,f=a;f>o&&!((!i||h(f)==v||f==a)&&p(f,-1,!0));f--);return l=new g(f,0),{start:l,end:u}}function Ht(e,r,t,n,i){function a(u){u.pos+u.dir<0||u.pos+u.dir>=u.line.length?u.line=null:u.pos+=u.dir}function o(u,f,h,p){var d=u.getLine(f),c={line:d,ln:f,pos:h,dir:p};if(c.line==="")return{ln:c.ln,pos:c.pos};var C=c.pos;for(a(c);c.line!==null;){if(C=c.pos,Oe(c.line[c.pos]))if(i){for(a(c);c.line!==null&&X(c.line[c.pos]);)C=c.pos,a(c);return{ln:c.ln,pos:C+1}}else return{ln:c.ln,pos:c.pos+1};a(c)}return{ln:c.ln,pos:C+1}}function s(u,f,h,p){var d=u.getLine(f),c={line:d,ln:f,pos:h,dir:p};if(c.line==="")return{ln:c.ln,pos:c.pos};var C=c.pos;for(a(c);c.line!==null;){if(!X(c.line[c.pos])&&!Oe(c.line[c.pos]))C=c.pos;else if(Oe(c.line[c.pos]))return i?X(c.line[c.pos+1])?{ln:c.ln,pos:c.pos+1}:{ln:c.ln,pos:C}:{ln:c.ln,pos:C};a(c)}return c.line=d,i&&X(c.line[c.pos])?{ln:c.ln,pos:c.pos}:{ln:c.ln,pos:C}}for(var l={ln:r.line,pos:r.ch};t>0;)n<0?l=s(e,l.ln,l.pos,n):l=o(e,l.ln,l.pos,n),t--;return new g(l.ln,l.pos)}function Nr(e,r,t,n){function i(l,u){if(u.pos+u.dir<0||u.pos+u.dir>=u.line.length){if(u.ln+=u.dir,!et(l,u.ln)){u.line=null,u.ln=null,u.pos=null;return}u.line=l.getLine(u.ln),u.pos=u.dir>0?0:u.line.length-1}else u.pos+=u.dir}function a(l,u,f,h){var v=l.getLine(u),p=v==="",d={line:v,ln:u,pos:f,dir:h},c={ln:d.ln,pos:d.pos},C=d.line==="";for(i(l,d);d.line!==null;){if(c.ln=d.ln,c.pos=d.pos,d.line===""&&!C)return{ln:d.ln,pos:d.pos};if(p&&d.line!==""&&!X(d.line[d.pos]))return{ln:d.ln,pos:d.pos};Oe(d.line[d.pos])&&!p&&(d.pos===d.line.length-1||X(d.line[d.pos+1]))&&(p=!0),i(l,d)}var v=l.getLine(c.ln);c.pos=0;for(var w=v.length-1;w>=0;--w)if(!X(v[w])){c.pos=w;break}return c}function o(l,u,f,h){var C=l.getLine(u),p={line:C,ln:u,pos:f,dir:h},d={ln:p.ln,pos:null},c=p.line==="";for(i(l,p);p.line!==null;){if(p.line===""&&!c)return d.pos!==null?d:{ln:p.ln,pos:p.pos};if(Oe(p.line[p.pos])&&d.pos!==null&&!(p.ln===d.ln&&p.pos+1===d.pos))return d;p.line!==""&&!X(p.line[p.pos])&&(c=!1,d={ln:p.ln,pos:p.pos}),i(l,p)}var C=l.getLine(d.ln);d.pos=0;for(var v=0;v0;)n<0?s=o(e,s.ln,s.pos,n):s=a(e,s.ln,s.pos,n),t--;return new g(s.ln,s.pos)}function _t(e,r,t,n){var i=r,a,o,s={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[t],l={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[t],u=e.getLine(i.line).charAt(i.ch),f=u===l?1:0;if(a=e.scanForBracket(new g(i.line,i.ch+f),-1,void 0,{bracketRegex:s}),o=e.scanForBracket(new g(i.line,i.ch+f),1,void 0,{bracketRegex:s}),!a||!o)return null;if(a=a.pos,o=o.pos,a.line==o.line&&a.ch>o.ch||a.line>o.line){var h=a;a=o,o=h}return n?o.ch+=1:a.ch+=1,{start:a,end:o}}function Pr(e,r,t,n){var i=A(r),a=e.getLine(i.line),o=a.split(""),s,l,u,f,h=o.indexOf(t);if(i.ch-1&&!s;u--)o[u]==t&&(s=u+1);if(s&&!l)for(u=s,f=o.length;u=r&&e<=t:e==r}function ht(e){var r=e.ace.renderer;return{top:r.getFirstFullyVisibleRow(),bottom:r.getLastFullyVisibleRow()}}function Ze(e,r,t){if(t=="'"||t=="`")return m.jumpList.find(e,-1)||new g(0,0);if(t==".")return Qt(e);var n=r.marks[t];return n&&n.find()}function Qt(e){if(e.getLastEditEnd)return e.getLastEditEnd();for(var r=e.doc.history.done,t=r.length;t--;)if(r[t].changes)return A(r[t].changes[0].to)}var Jt=function(){this.buildCommandMap_()};Jt.prototype={processCommand:function(e,r,t){var n=this;e.operation(function(){e.curOp.isVimOp=!0,n._processCommand(e,r,t)})},_processCommand:function(e,r,t){var n=e.state.vim,i=m.registerController.getRegister(":"),a=i.toString(),o=new y.StringStream(r);i.setText(r);var s=t||{};s.input=r;try{this.parseInput_(e,o,s)}catch(f){throw b(e,f.toString()),f}n.visualMode&&ae(e);var l,u;if(!s.commandName)s.line!==void 0&&(u="move");else if(l=this.matchCommand_(s.commandName),l){if(u=l.name,l.excludeFromCommandHistory&&i.setText(a),this.parseCommandArgs_(o,s,l),l.type=="exToKey"){_e(e,l.toKeys,l);return}else if(l.type=="exToEx"){this.processCommand(e,l.toInput);return}}if(!u){b(e,'Not an editor command ":'+r+'"');return}try{zt[u](e,s),(!l||!l.possiblyAsync)&&s.callback&&s.callback()}catch(f){throw b(e,f.toString()),f}},parseInput_:function(e,r,t){if(r.eatWhile(":"),r.eat("%")?(t.line=e.firstLine(),t.lineEnd=e.lastLine()):(t.line=this.parseLineSpec_(e,r),t.line!==void 0&&r.eat(",")&&(t.lineEnd=this.parseLineSpec_(e,r))),t.line==null)if(e.state.vim.visualMode){var n=Ze(e,e.state.vim,"<");t.selectionLine=n&&n.line,n=Ze(e,e.state.vim,">"),t.selectionLineEnd=n&&n.line}else t.selectionLine=e.getCursor().line;else t.selectionLine=t.line,t.selectionLineEnd=t.lineEnd;var i=r.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return i?t.commandName=i[1]:t.commandName=r.match(/.*/)[0],t},parseLineSpec_:function(e,r){var t=r.match(/^(\d+)/);if(t)return parseInt(t[1],10)-1;switch(r.next()){case".":return this.parseLineSpecOffset_(r,e.getCursor().line);case"$":return this.parseLineSpecOffset_(r,e.lastLine());case"'":var n=r.next(),i=Ze(e,e.state.vim,n);if(!i)throw new Error("Mark not set");return this.parseLineSpecOffset_(r,i.line);case"-":case"+":return r.backUp(1),this.parseLineSpecOffset_(r,e.getCursor().line);default:r.backUp(1);return}},parseLineSpecOffset_:function(e,r){var t=e.match(/^([+-])?(\d+)/);if(t){var n=parseInt(t[2],10);t[1]=="-"?r-=n:r+=n}return r},parseCommandArgs_:function(e,r,t){if(!e.eol()){r.argString=e.match(/.*/)[0];var n=t.argDelimiter||/\s+/,i=st(r.argString).split(n);i.length&&i[0]&&(r.args=i)}},matchCommand_:function(e){for(var r=e.length;r>0;r--){var t=e.substring(0,r);if(this.commandMap_[t]){var n=this.commandMap_[t];if(n.name.indexOf(e)===0)return n}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e1)return"Invalid arguments";a=U&&"decimal"||P&&"hex"||H&&"octal"}x[2]&&(o=new RegExp(x[2].substr(1,x[2].length-2),n?"i":""))}}var l=s();if(l){b(e,l+": "+r.argString);return}var u=r.line||e.firstLine(),f=r.lineEnd||r.line||e.lastLine();if(u==f)return;var h=new g(u,0),p=new g(f,$(e,f)),d=e.getRange(h,p).split(`
`),c=o||(a=="decimal"?/(-?)([\d]+)/:a=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:a=="octal"?/([0-7]+)/:null),C=a=="decimal"?10:a=="hex"?16:a=="octal"?8:null,v=[],w=[];if(a||o)for(var M=0;M=u){b(e,"Invalid argument: "+r.argString.substring(i));return}for(var f=0;f<=u-l;f++){var h=String.fromCharCode(l+f);delete t.marks[h]}}else{b(e,"Invalid argument: "+o+"-");return}}else delete t.marks[a]}}},oe=new Jt;function zr(e,r,t,n,i,a,o,s,l){e.state.vim.exMode=!0;var u=!1,f,h,p;function d(){e.operation(function(){for(;!u;)c(),v();w()})}function c(){var k=e.getRange(a.from(),a.to()),L=k.replace(o,s),_=a.to().line;a.replace(L),h=a.to().line,i+=h-_,p=h<_}function C(){var k=f&&A(a.to()),L=a.findNext();return L&&!L[0]&&k&&ee(a.from(),k)&&(L=a.findNext()),L}function v(){for(;C()&&Jr(a.from(),n,i);)if(!(!t&&a.from().line==h&&!p)){e.scrollIntoView(a.from(),30),e.setSelection(a.from(),a.to()),f=a.from(),u=!1;return}u=!0}function w(k){if(k&&k(),e.focus(),f){e.setCursor(f);var L=e.state.vim;L.exMode=!1,L.lastHPos=L.lastHSPos=f.ch}l&&l()}function M(k,L,_){y.e_stop(k);var O=De(k);switch(O){case"y":c(),v();break;case"n":v();break;case"a":var D=l;l=void 0,e.operation(d),l=D;break;case"l":c();case"q":case"":case"":case"":w(_);break}return u&&w(_),!0}if(v(),u){b(e,"No matches for "+o.source);return}if(!r){d(),l&&l();return}$e(e,{prefix:we("span","replace with ",we("strong",s)," (y/n/a/q/l)"),onKeyDown:M})}function me(e,r){var t=e.state.vim,n=m.macroModeState,i=m.registerController.getRegister("."),a=n.isPlaying,o=n.lastInsertModeChanges;a||(e.off("change",Xt),t.insertEnd&&t.insertEnd.clear(),t.insertEnd=null,y.off(e.getInputField(),"keydown",qt)),!a&&t.insertModeRepeat>1&&(er(e,t,t.insertModeRepeat-1,!0),t.lastEditInputState.repeatOverride=t.insertModeRepeat),delete t.insertModeRepeat,t.insertMode=!1,r||e.setCursor(e.getCursor().line,e.getCursor().ch-1),e.setOption("keyMap","vim"),e.setOption("disableInput",!0),e.toggleOverwrite(!1),i.setText(o.changes.join("")),y.signal(e,"vim-mode-change",{mode:"normal"}),n.isRecording&&Yr(n)}function Gt(e){I.unshift(e)}function Gr(e,r,t,n,i){var a={keys:e,type:r};a[r]=t,a[r+"Args"]=n;for(var o in i)a[o]=i[o];Gt(a)}be("insertModeEscKeysTimeout",200,"number");function Xr(e,r,t,n){var i=m.registerController.getRegister(n);if(n==":"){i.keyBuffer[0]&&oe.processCommand(e,i.keyBuffer[0]),t.isPlaying=!1;return}var a=i.keyBuffer,o=0;t.isPlaying=!0,t.replaySearchQueries=i.searchQueries.slice(0);for(var s=0;s|<\w+>|./.exec(l),f=u[0],l=l.substring(u.index+f.length),B.handleKey(e,f,"macro"),r.insertMode){var h=i.insertModeChanges[o++].changes;m.macroModeState.lastInsertModeChanges.changes=h,rr(e,h,1),me(e)}t.isPlaying=!1}function Zr(e,r){if(!e.isPlaying){var t=e.latestRegister,n=m.registerController.getRegister(t);n&&n.pushText(r)}}function Yr(e){if(!e.isPlaying){var r=e.latestRegister,t=m.registerController.getRegister(r);t&&t.pushInsertModeChanges&&t.pushInsertModeChanges(e.lastInsertModeChanges)}}function qr(e,r){if(!e.isPlaying){var t=e.latestRegister,n=m.registerController.getRegister(t);n&&n.pushSearchQuery&&n.pushSearchQuery(r)}}function Xt(e,r){var t=m.macroModeState,n=t.lastInsertModeChanges;if(!t.isPlaying)for(var i=e.state.vim;r;){if(n.expectCursorActivityForChange=!0,n.ignoreCount>1)n.ignoreCount--;else if(r.origin=="+input"||r.origin=="paste"||r.origin===void 0){var a=e.listSelections().length;a>1&&(n.ignoreCount=a);var o=r.text.join(`
`);if(n.maybeReset&&(n.changes=[],n.maybeReset=!1),o)if(e.state.overwrite&&!/\n/.test(o))n.changes.push([o]);else{if(o.length>1){var s=i&&i.insertEnd&&i.insertEnd.find(),l=e.getCursor();if(s&&s.line==l.line){var u=s.ch-l.ch;u>0&&u",Ce(i,n))}else!r.insertMode&&!t&&(r.lastHPos=e.getCursor().ch)}function dt(e,r){this.keyName=e,this.key=r.key,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.metaKey=r.metaKey,this.shiftKey=r.shiftKey}function qt(e){var r=m.macroModeState,t=r.lastInsertModeChanges,n=y.keyName?y.keyName(e):e.key;n&&(n.indexOf("Delete")!=-1||n.indexOf("Backspace")!=-1)&&(t.maybeReset&&(t.changes=[],t.maybeReset=!1),t.changes.push(new dt(n,e)))}function er(e,r,t,n){var i=m.macroModeState;i.isPlaying=!0;var a=!!r.lastEditActionCommand,o=r.inputState;function s(){a?Le.processAction(e,r,r.lastEditActionCommand):Le.evalInput(e,r)}function l(f){if(i.lastInsertModeChanges.changes.length>0){f=r.lastEditActionCommand?f:1;var h=i.lastInsertModeChanges;rr(e,h.changes,f)}}if(r.inputState=r.lastEditInputState,a&&r.lastEditActionCommand.interlaceInsertRepeat)for(var u=0;u1&&r[0]=="n"&&(r=r.replace("numpad","")),r=en[r]||r;var i="";if(t.ctrlKey&&(i+="C-"),t.altKey&&(i+="A-"),(i||r.length>1)&&t.shiftKey&&(i+="S-"),n&&!n.expectLiteralNext&&r.length==1){if(Q.keymap&&r in Q.keymap)(Q.remapCtrl!==!1||!i)&&(r=Q.keymap[r]);else if(r.charCodeAt(0)>255){var a=t.code&&t.code.slice(-1)||"";t.shiftKey||(a=a.toLowerCase()),a&&(r=a)}}return i+=r,i.length>1&&(i="<"+i+">"),i}var nr=B.handleKey.bind(B);B.handleKey=function(e,r,t){return e.operation(function(){return nr(e,r,t)},!0)};function pt(e){var r=new e.constructor;return Object.keys(e).forEach(function(t){if(t!="insertEnd"){var n=e[t];Array.isArray(n)?n=n.slice():n&&typeof n=="object"&&n.constructor!=Object&&(n=pt(n)),r[t]=n}}),e.sel&&(r.sel={head:e.sel.head&&A(e.sel.head),anchor:e.sel.anchor&&A(e.sel.anchor)}),r}function ir(e,r,t){var n=!1,i=B.maybeInitVimState_(e),a=i.visualBlock||i.wasInVisualBlock,o=e.ace.inMultiSelectMode;if(i.wasInVisualBlock&&!o?i.wasInVisualBlock=!1:o&&i.visualBlock&&(i.wasInVisualBlock=!0),r==""&&!i.insertMode&&!i.visualMode&&o)e.ace.exitMultiSelectMode();else if(a||!o||e.ace.inVirtualSelectionMode)n=B.handleKey(e,r,t);else{var s=pt(i),l=i.inputState.changeQueueList||[];e.operation(function(){e.curOp.isVimOp=!0;var u=0;e.ace.forEachSelection(function(){var f=e.ace.selection;e.state.vim.lastHPos=f.$desiredColumn==null?f.lead.column:f.$desiredColumn,e.state.vim.inputState.changeQueue=l[u];var h=e.getCursor("head"),p=e.getCursor("anchor"),d=R(h,p)?0:-1,c=R(h,p)?-1:0;h=N(h,0,d),p=N(p,0,c),e.state.vim.sel.head=h,e.state.vim.sel.anchor=p,n=nr(e,r,t),f.$desiredColumn=e.state.vim.lastHPos==-1?null:e.state.vim.lastHPos,e.ace.inVirtualSelectionMode&&(l[u]=e.state.vim.inputState.changeQueue),e.virtualSelectionMode()&&(e.state.vim=pt(s)),u++}),e.curOp.cursorActivity&&!n&&(e.curOp.cursorActivity=!1),i.status=e.state.vim.status,e.state.vim=i,i.inputState.changeQueueList=l,i.inputState.changeQueue=null},!0)}return n&&!i.visualMode&&!i.insert&&i.visualMode!=e.somethingSelected()&&Yt(e,i,!0),n}kt(),Y.CodeMirror=y;var Ae=B.maybeInitVimState_;Y.handler={$id:"ace/keyboard/vim",drawCursor:function(e,r,t,n,i){var a=this.state.vim||{},o=t.characterWidth,s=t.lineHeight,l=r.top,u=r.left;if(!a.insertMode){var f=n.cursor?J.comparePoints(n.cursor,n.start)<=0:i.selection.isBackwards()||i.selection.isEmpty();!f&&u>o&&(u-=o)}!a.insertMode&&a.status&&(s=s/2,l+=s),Te.translate(e,u,l),Te.setStyle(e.style,"width",o+"px"),Te.setStyle(e.style,"height",s+"px")},$getDirectionForHighlight:function(e){var r=e.state.cm,t=Ae(r);if(!t.insertMode)return e.session.selection.isBackwards()||e.session.selection.isEmpty()},handleKeyboard:function(e,r,t,n,i){var a=e.editor,o=a.state.cm,s=Ae(o);if(n!=-1){if(s.insertMode||(r==-1?(t.charCodeAt(0)>255&&e.inputKey&&(t=e.inputKey,t&&e.inputHash==4&&(t=t.toUpperCase())),e.inputChar=t):r==4||r==0?e.inputKey==t&&e.inputHash==r&&e.inputChar?(t=e.inputChar,r=-1):(e.inputChar=null,e.inputKey=t,e.inputHash=r):e.inputChar=e.inputKey=null),o.state.overwrite&&s.insertMode&&t=="backspace"&&r==0)return{command:"gotoleft"};if(t=="c"&&r==1&&!j.isMac&&a.getCopyText())return a.once("copy",function(){s.insertMode?a.selection.clearSelection():o.operation(function(){ae(o)})}),{command:"null",passEvent:!0};if(t=="esc"&&!s.insertMode&&!s.visualMode&&!o.ace.inMultiSelectMode){var l=te(o),u=l.getOverlay();u&&o.removeOverlay(u)}if(r==-1||r&1||r===0&&t.length>1){var f=s.insertMode,h=tn(r,t,i||{},s);s.status==null&&(s.status="");var p=ir(o,h,"user");return s=Ae(o),p&&s.status!=null?s.status+=h:s.status==null&&(s.status=""),o._signal("changeStatus"),!p&&(r!=-1||f)?void 0:{command:"null",passEvent:!p}}}},attach:function(e){e.state||(e.state={});var r=new y(e);e.state.cm=r,e.$vimModeHandler=this,Qe(r),Ae(r).status=null,r.on("vim-command-done",function(){r.virtualSelectionMode()||(Ae(r).status=null,r.ace._signal("changeStatus"),r.ace.session.markUndoGroup())}),r.on("changeStatus",function(){r.ace.renderer.updateCursor(),r.ace._signal("changeStatus")}),r.on("vim-mode-change",function(){r.virtualSelectionMode()||(t(),r._signal("changeStatus"))});function t(){var n=Ae(r).insertMode;r.ace.renderer.setStyle("normal-mode",!n),e.textInput.setCommandMode(!n),e.renderer.$keepTextAreaAtCursor=n,e.renderer.$blockCursor=!n}t(),e.renderer.$cursorLayer.drawCursor=this.drawCursor.bind(r)},detach:function(e){var r=e.state.cm;Je(r),r.destroy(),e.state.cm=null,e.$vimModeHandler=null,e.renderer.$cursorLayer.drawCursor=null,e.renderer.setStyle("normal-mode",!1),e.textInput.setCommandMode(!1),e.renderer.$keepTextAreaAtCursor=!0},getStatusText:function(e){var r=e.state.cm,t=Ae(r);if(t.insertMode)return"INSERT";var n="";return t.visualMode&&(n+="VISUAL",t.visualLine&&(n+=" LINE"),t.visualBlock&&(n+=" BLOCK")),t.status&&(n+=(n?" ":"")+t.status),n}},B.defineOption({name:"wrap",set:function(e,r){r&&r.ace.setOption("wrap",e)},type:"boolean"},!1),B.defineEx("write","w",function(){console.log(":write is not implemented")}),I.push({keys:"zc",type:"action",action:"fold",actionArgs:{open:!1}},{keys:"zC",type:"action",action:"fold",actionArgs:{open:!1,all:!0}},{keys:"zo",type:"action",action:"fold",actionArgs:{open:!0}},{keys:"zO",type:"action",action:"fold",actionArgs:{open:!0,all:!0}},{keys:"za",type:"action",action:"fold",actionArgs:{toggle:!0}},{keys:"zA",type:"action",action:"fold",actionArgs:{toggle:!0,all:!0}},{keys:"zf",type:"action",action:"fold",actionArgs:{open:!0,all:!0}},{keys:"zd",type:"action",action:"fold",actionArgs:{open:!0,all:!0}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"addCursorAbove"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"addCursorBelow"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"addCursorAboveSkipCurrent"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"addCursorBelowSkipCurrent"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"selectMoreBefore"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"selectMoreAfter"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"selectNextBefore"}},{keys:"",type:"action",action:"aceCommand",actionArgs:{name:"selectNextAfter"}}),I.push({keys:"gq",type:"operator",operator:"hardWrap"}),B.defineOperator("hardWrap",function(e,r,t,n,i){var a=t[0].anchor.line,o=t[0].head.line;return r.linewise&&o--,ve(e.ace,{startRow:a,endRow:o}),g(o,0)}),be("textwidth",void 0,"number",["tw"],function(e,r){if(r!==void 0)if(e===void 0){var t=r.ace.getOption("printMarginColumn");return t}else{var n=Math.round(e);n>1&&r.ace.setOption("printMarginColumn",n)}}),de.aceCommand=function(e,r,t){e.vimCmd=r,e.ace.inVirtualSelectionMode?e.ace.on("beforeEndOperation",vt):vt(null,e.ace)};function vt(e,r){r.off("beforeEndOperation",vt);var t=r.state.cm.vimCmd;t&&r.execCommand(t.exec?t:t.name,t.args),r.curOp=r.prevOp}de.fold=function(e,r,t){e.ace.execCommand(["toggleFoldWidget","toggleFoldWidget","foldOther","unfoldall"][(r.all?2:0)+(r.open?1:0)])},Se=I.length,Y.handler.defaultKeymap=I,Y.handler.actions=de,Y.Vim=B});(function(){ace.require(["ace/keyboard/vim"],function(E){typeof Ye=="object"&&typeof ar=="object"&&Ye&&(Ye.exports=E)})})()});on();})();
//# sourceMappingURL=d09463c099fb2c44719380623a5c68fb.js.map