D7net Mini Sh3LL v1
Current File : /var/www/html/hpsc/../informatica/media/system/../com_akeeba/../jui/../contacts/../com_wrapper/../editors/codemirror/mode/../keymap/vim.min.js |
!function(a){"object"==typeof exports&&"object"==typeof module?a(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/dialog/dialog"),require("../addon/edit/matchbrackets.js")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/dialog/dialog","../addon/edit/matchbrackets"],a):a(CodeMirror)}(function(a){"use strict";var b=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"xi",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"dcc",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{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:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",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:"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<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<character>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<character>",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:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",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:"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:"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:"moveToEol",motionArgs:{inclusive:!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:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",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:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},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:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",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<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<character>",type:"action",action:"replayMacro"},{keys:"q<character>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!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:"<C-r>",type:"action",action:"redo"},{keys:"m<character>",type:"action",action:"setMark"},{keys:'"<character>',type:"action",action:"setRegister"},{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<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"a<character>",type:"motion",motion:"textObjectManipulation"},{keys:"i<character>",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"}],c=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],d=a.Pos,e=function(){function e(b){b.setOption("disableInput",!0),b.setOption("showCursorWhenSelecting",!1),a.signal(b,"vim-mode-change",{mode:"normal"}),b.on("cursorActivity",ab),x(b),a.on(b.getInputField(),"paste",k(b))}function f(b){b.setOption("disableInput",!1),b.off("cursorActivity",ab),a.off(b.getInputField(),"paste",k(b)),b.state.vim=null}function g(b,c){this==a.keyMap.vim&&a.rmClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||f(b,!1)}function h(b,c){this==a.keyMap.vim&&a.addClass(b.getWrapperElement(),"cm-fat-cursor"),c&&c.attach==h||e(b)}function i(b,c){if(!c)return void 0;var d=j(b);if(!d)return!1;var e=a.Vim.findKey(c,d);return"function"==typeof e&&a.signal(c,"vim-keypress",d),e}function j(a){if("'"==a.charAt(0))return a.charAt(1);var b=a.split("-");/-$/.test(a)&&b.splice(-2,2,"-");var c=b[b.length-1];if(1==b.length&&1==b[0].length)return!1;if(2==b.length&&"Shift"==b[0]&&1==c.length)return!1;for(var d=!1,e=0;e<b.length;e++){var f=b[e];f in hb?b[e]=hb[f]:d=!0,f in ib&&(b[e]=ib[f])}return d?(q(c)&&(b[b.length-1]=c.toLowerCase()),"<"+b.join("-")+">"):!1}function k(a){var b=a.state.vim;return b.onPasteFn||(b.onPasteFn=function(){b.insertMode||(a.setCursor(L(a.getCursor(),0,1)),Ab.enterInsertMode(a,{},b))}),b.onPasteFn}function l(a,b){for(var c=[],d=a;a+b>d;d++)c.push(String.fromCharCode(d));return c}function m(a,b){return b>=a.firstLine()&&b<=a.lastLine()}function n(a){return/^[a-z]$/.test(a)}function o(a){return-1!="()[]{}".indexOf(a)}function p(a){return jb.test(a)}function q(a){return/^[A-Z]$/.test(a)}function r(a){return/^\s*$/.test(a)}function s(a,b){for(var c=0;c<b.length;c++)if(b[c]==a)return!0;return!1}function t(a,b,c,d,e){if(void 0===b&&!e)throw Error("defaultValue is required unless callback is provided");if(c||(c="string"),rb[a]={type:c,defaultValue:b,callback:e},d)for(var f=0;f<d.length;f++)rb[d[f]]=rb[a];b&&u(a,b)}function u(a,b,c,d){var e=rb[a];d=d||{};var f=d.scope;if(!e)throw Error("Unknown option: "+a);if("boolean"==e.type){if(b&&b!==!0)throw Error("Invalid argument: "+a+"="+b);b!==!1&&(b=!0)}e.callback?("local"!==f&&e.callback(b,void 0),"global"!==f&&c&&e.callback(b,c)):("local"!==f&&(e.value="boolean"==e.type?!!b:b),"global"!==f&&c&&(c.state.vim.options[a]={value:b}))}function v(a,b,c){var d=rb[a];c=c||{};var e=c.scope;if(!d)throw Error("Unknown option: "+a);{if(!d.callback){var f="global"!==e&&b&&b.state.vim.options[a];return(f||"local"!==e&&d||{}).value}var f=b&&d.callback(void 0,b);if("global"!==e&&void 0!==f)return f;if("local"!==e)return d.callback()}}function w(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=tb()}function x(a){return a.state.vim||(a.state.vim={inputState:new z,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},fakeCursor:null,insertMode:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:null,sel:{},options:{}}),a.state.vim}function y(){ub={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:sb(),macroModeState:new w,lastChararacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new D({}),searchHistoryController:new E({}),exCommandHistoryController:new E({})};for(var a in rb){var b=rb[a];b.value=b.defaultValue}}function z(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=null}function A(b,c){b.state.vim.inputState=new z,a.signal(b,"vim-command-done",c)}function B(a,b,c){this.clear(),this.keyBuffer=[a||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!b,this.blockwise=!!c}function C(a,b){var c=ub.registerController.registers[a];if(!a||1!=a.length)throw Error("Register name must be 1 character");if(c[a])throw Error("Register already defined "+a);c[a]=b,qb.push(a)}function D(a){this.registers=a,this.unnamedRegister=a['"']=new B,a["."]=new B,a[":"]=new B,a["/"]=new B}function E(){this.historyBuffer=[],this.iterator,this.initialPrefix=null}function F(a,b){yb[a]=b}function G(a,b){for(var c=[],d=0;b>d;d++)c.push(a);return c}function H(a,b){zb[a]=b}function I(a,b){Ab[a]=b}function J(a,b,c){var e=Math.min(Math.max(a.firstLine(),b.line),a.lastLine()),f=X(a,e)-1;f=c?f+1:f;var g=Math.min(Math.max(0,b.ch),f);return d(e,g)}function K(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function L(a,b,c){return"object"==typeof b&&(c=b.ch,b=b.line),d(a.line+b,a.ch+c)}function M(a,b){return{line:b.line-a.line,ch:b.line-a.line}}function N(a,b,c,d){for(var e,f=[],g=[],h=0;h<b.length;h++){var i=b[h];"insert"==c&&"insert"!=i.context||i.context&&i.context!=c||d.operator&&"action"==i.type||!(e=O(a,i.keys))||("partial"==e&&f.push(i),"full"==e&&g.push(i))}return{partial:f.length&&f,full:g.length&&g}}function O(a,b){if("<character>"==b.slice(-11)){var c=b.length-11,d=a.slice(0,c),e=b.slice(0,c);return d==e&&a.length>c?"full":0==e.indexOf(d)?"partial":!1}return a==b?"full":0==b.indexOf(a)?"partial":!1}function P(a){var b=/^.*(<[\w\-]+>)$/.exec(a),c=b?b[1]:a.slice(-1);if(c.length>1)switch(c){case"<CR>":c="\n";break;case"<Space>":c=" "}return c}function Q(a,b,c){return function(){for(var d=0;c>d;d++)b(a)}}function R(a){return d(a.line,a.ch)}function S(a,b){return a.ch==b.ch&&a.line==b.line}function T(a,b){return a.line<b.line?!0:a.line==b.line&&a.ch<b.ch?!0:!1}function U(a,b){return arguments.length>2&&(b=U.apply(void 0,Array.prototype.slice.call(arguments,1))),T(a,b)?a:b}function V(a,b){return arguments.length>2&&(b=V.apply(void 0,Array.prototype.slice.call(arguments,1))),T(a,b)?b:a}function W(a,b,c){var d=T(a,b),e=T(b,c);return d&&e}function X(a,b){return a.getLine(b).length}function Y(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function Z(a){return a.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function $(a,b,c){var e=X(a,b),f=new Array(c-e+1).join(" ");a.setCursor(d(b,e)),a.replaceRange(f,a.getCursor())}function _(a,b){var c=[],e=a.listSelections(),f=R(a.clipPos(b)),g=!S(b,f),h=a.getCursor("head"),i=ba(e,h),j=S(e[i].head,e[i].anchor),k=e.length-1,l=k-i>i?k:0,m=e[l].anchor,n=Math.min(m.line,f.line),o=Math.max(m.line,f.line),p=m.ch,q=f.ch,r=e[l].head.ch-p,s=q-p;r>0&&0>=s?(p++,g||q--):0>r&&s>=0?(p--,j||q++):0>r&&-1==s&&(p--,q++);for(var t=n;o>=t;t++){var u={anchor:new d(t,p),head:new d(t,q)};c.push(u)}return i=f.line==o?c.length-1:0,a.setSelections(c),b.ch=q,m.ch=p,m}function aa(a,b,c){for(var d=[],e=0;c>e;e++){var f=L(b,e,0);d.push({anchor:f,head:f})}a.setSelections(d,0)}function ba(a,b,c){for(var d=0;d<a.length;d++){var e="head"!=c&&S(a[d].anchor,b),f="anchor"!=c&&S(a[d].head,b);if(e||f)return d}return-1}function ca(a,b){var c=b.lastSelection,e=function(){var b=a.listSelections(),c=b[0],d=b[b.length-1],e=T(c.anchor,c.head)?c.anchor:c.head,f=T(d.anchor,d.head)?d.head:d.anchor;return[e,f]},f=function(){var b=a.getCursor(),e=a.getCursor(),f=c.visualBlock;if(f){var g=f.width,h=f.height;e=d(b.line+h,b.ch+g);for(var i=[],j=b.line;j<e.line;j++){var k=d(j,b.ch),l=d(j,e.ch),m={anchor:k,head:l};i.push(m)}a.setSelections(i)}else{var n=c.anchorMark.find(),o=c.headMark.find(),p=o.line-n.line,q=o.ch-n.ch;e={line:e.line+p,ch:p?e.ch:q+e.ch},c.visualLine&&(b=d(b.line,0),e=d(e.line,X(a,e.line))),a.setSelection(b,e)}return[b,e]};return b.visualMode?e():f()}function da(a,b){var c=b.sel.anchor,d=b.sel.head;b.lastPastedText&&(d=a.posFromIndex(a.indexFromPos(c)+b.lastPastedText.length),b.lastPastedText=null),b.lastSelection={anchorMark:a.setBookmark(c),headMark:a.setBookmark(d),anchor:R(c),head:R(d),visualMode:b.visualMode,visualLine:b.visualLine,visualBlock:b.visualBlock}}function ea(a,b,c){var e,f=a.state.vim.sel,g=f.head,h=f.anchor;return T(c,b)&&(e=c,c=b,b=e),T(g,h)?(g=U(b,g),h=V(h,c)):(h=U(b,h),g=V(g,c),g=L(g,0,-1),-1==g.ch&&g.line!=a.firstLine()&&(g=d(g.line-1,X(a,g.line-1)))),[h,g]}function fa(a,b,c){var d=a.state.vim;b=b||d.sel;var c=c||d.visualLine?"line":d.visualBlock?"block":"char",e=ga(a,b,c);a.setSelections(e.ranges,e.primary),bb(a)}function ga(a,b,c,e){var f=R(b.head),g=R(b.anchor);if("char"==c){var h=e||T(b.head,b.anchor)?0:1,i=T(b.head,b.anchor)?1:0;return f=L(b.head,0,h),g=L(b.anchor,0,i),{ranges:[{anchor:g,head:f}],primary:0}}if("line"==c){if(T(b.head,b.anchor))f.ch=0,g.ch=X(a,g.line);else{g.ch=0;var j=a.lastLine();f.line>j&&(f.line=j),f.ch=X(a,f.line)}return{ranges:[{anchor:g,head:f}],primary:0}}if("block"==c){for(var k=Math.min(g.line,f.line),l=Math.min(g.ch,f.ch),m=Math.max(g.line,f.line),n=Math.max(g.ch,f.ch)+1,o=m-k+1,p=f.line==k?0:o-1,q=[],r=0;o>r;r++)q.push({anchor:d(k+r,l),head:d(k+r,n)});return{ranges:q,primary:p}}}function ha(a){var b=a.getCursor("head");return 1==a.getSelection().length&&(b=U(b,a.getCursor("anchor"))),b}function ia(b,c){var d=b.state.vim;c!==!1&&b.setCursor(J(b,d.sel.head)),da(b,d),d.visualMode=!1,d.visualLine=!1,d.visualBlock=!1,a.signal(b,"vim-mode-change",{mode:"normal"}),d.fakeCursor&&d.fakeCursor.clear()}function ja(a,b,c){var d=a.getRange(b,c);if(/\n\s*$/.test(d)){var e=d.split("\n");e.pop();for(var f,f=e.pop();e.length>0&&f&&r(f);f=e.pop())c.line--,c.ch=0;f?(c.line--,c.ch=X(a,c.line)):c.ch=0}}function ka(a,b,c){b.ch=0,c.ch=0,c.line++}function la(a){if(!a)return 0;var b=a.search(/\S/);return-1==b?a.length:b}function ma(a,b,c,e,f){for(var g=ha(a),h=a.getLine(g.line),i=g.ch,j=f?kb[0]:lb[0];!j(h.charAt(i));)if(i++,i>=h.length)return null;e?j=lb[0]:(j=kb[0],j(h.charAt(i))||(j=kb[1]));for(var k=i,l=i;j(h.charAt(k))&&k<h.length;)k++;for(;j(h.charAt(l))&&l>=0;)l--;if(l++,b){for(var m=k;/\s/.test(h.charAt(k))&&k<h.length;)k++;if(m==k){for(var n=l;/\s/.test(h.charAt(l-1))&&l>0;)l--;l||(l=n)}}return{start:d(g.line,l),end:d(g.line,k)}}function na(a,b,c){S(b,c)||ub.jumpList.add(a,b,c)}function oa(a,b){ub.lastChararacterSearch.increment=a,ub.lastChararacterSearch.forward=b.forward,ub.lastChararacterSearch.selectedCharacter=b.selectedCharacter}function pa(a,b,c,e){var f=R(a.getCursor()),g=c?1:-1,h=c?a.lineCount():-1,i=f.ch,j=f.line,k=a.getLine(j),l={lineText:k,nextCh:k.charAt(i),lastCh:null,index:i,symb:e,reverseSymb:(c?{")":"(","}":"{"}:{"(":")","{":"}"})[e],forward:c,depth:0,curMoveThrough:!1},m=Bb[e];if(!m)return f;var n=Cb[m].init,o=Cb[m].isComplete;for(n&&n(l);j!==h&&b;){if(l.index+=g,l.nextCh=l.lineText.charAt(l.index),!l.nextCh){if(j+=g,l.lineText=a.getLine(j)||"",g>0)l.index=0;else{var p=l.lineText.length;l.index=p>0?p-1:0}l.nextCh=l.lineText.charAt(l.index)}o(l)&&(f.line=j,f.ch=l.index,b--)}return l.nextCh||l.curMoveThrough?d(j,l.index):f}function qa(a,b,c,d,e){var f=b.line,g=b.ch,h=a.getLine(f),i=c?1:-1,j=d?lb:kb;if(e&&""==h){if(f+=i,h=a.getLine(f),!m(a,f))return null;g=c?0:h.length}for(;;){if(e&&""==h)return{from:0,to:0,line:f};for(var k=i>0?h.length:-1,l=k,n=k;g!=k;){for(var o=!1,p=0;p<j.length&&!o;++p)if(j[p](h.charAt(g))){for(l=g;g!=k&&j[p](h.charAt(g));)g+=i;if(n=g,o=l!=n,l==b.ch&&f==b.line&&n==l+i)continue;return{from:Math.min(l,n+1),to:Math.max(l,n),line:f}}o||(g+=i)}if(f+=i,!m(a,f))return null;h=a.getLine(f),g=i>0?0:h.length}throw new Error("The impossible happened.")}function ra(a,b,c,e,f,g){var h=R(b),i=[];(e&&!f||!e&&f)&&c++;for(var j=!(e&&f),k=0;c>k;k++){var l=qa(a,b,e,g,j);if(!l){var m=X(a,a.lastLine());i.push(e?{line:a.lastLine(),from:m,to:m}:{line:0,from:0,to:0});break}i.push(l),b=d(l.line,e?l.to-1:l.from)}var n=i.length!=c,o=i[0],p=i.pop();return e&&!f?(n||o.from==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.from)):e&&f?d(p.line,p.to-1):!e&&f?(n||o.to==h.ch&&o.line==h.line||(p=i.pop()),d(p.line,p.to)):d(p.line,p.from)}function sa(a,b,c,e){for(var f,g=a.getCursor(),h=g.ch,i=0;b>i;i++){var j=a.getLine(g.line);if(f=va(h,j,e,c,!0),-1==f)return null;h=f}return d(a.getCursor().line,f)}function ta(a,b){var c=a.getCursor().line;return J(a,d(c,b-1))}function ua(a,b,c,d){s(c,pb)&&(b.marks[c]&&b.marks[c].clear(),b.marks[c]=a.setBookmark(d))}function va(a,b,c,d,e){var f;return d?(f=b.indexOf(c,a+1),-1==f||e||(f-=1)):(f=b.lastIndexOf(c,a-1),-1==f||e||(f+=1)),f}function wa(a,b,c,e,f){function g(b){return!a.getLine(b)}function h(a,b,c){return c?g(a)!=g(a+b):!g(a)&&g(a+b)}var i,j,k=b.line,l=a.firstLine(),m=a.lastLine(),n=k;if(e){for(;n>=l&&m>=n&&c>0;)h(n,e)&&c--,n+=e;return new d(n,0)}var o=a.state.vim;if(o.visualLine&&h(k,1,!0)){var p=o.sel.anchor;h(p.line,-1,!0)&&(f&&p.line==k||(k+=1))}var q=g(k);for(n=k;m>=n&&c;n++)h(n,1,!0)&&(f&&g(n)==q||c--);for(j=new d(n,0),n>m&&!q?q=!0:f=!1,n=k;n>l&&(f&&g(n)!=q&&n!=k||!h(n,-1,!0));n--);return i=new d(n,0),{start:i,end:j}}function xa(a,b,c,e){var f,g,h=b,i={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[c],j={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[c],k=a.getLine(h.line).charAt(h.ch),l=k===j?1:0;if(f=a.scanForBracket(d(h.line,h.ch+l),-1,null,{bracketRegex:i}),g=a.scanForBracket(d(h.line,h.ch+l),1,null,{bracketRegex:i}),!f||!g)return{start:h,end:h};if(f=f.pos,g=g.pos,f.line==g.line&&f.ch>g.ch||f.line>g.line){var m=f;f=g,g=m}return e?g.ch+=1:f.ch+=1,{start:f,end:g}}function ya(a,b,c,e){var f,g,h,i,j=R(b),k=a.getLine(j.line),l=k.split(""),m=l.indexOf(c);if(j.ch<m?j.ch=m:m<j.ch&&l[j.ch]==c&&(g=j.ch,--j.ch),l[j.ch]!=c||g)for(h=j.ch;h>-1&&!f;h--)l[h]==c&&(f=h+1);else f=j.ch+1;if(f&&!g)for(h=f,i=l.length;i>h&&!g;h++)l[h]==c&&(g=h);return f&&g?(e&&(--f,++g),{start:d(j.line,f),end:d(j.line,g)}):{start:j,end:j}}function za(){}function Aa(a){var b=a.state.vim;return b.searchState_||(b.searchState_=new za)}function Ba(a,b,c,d,e){a.openDialog?a.openDialog(b,d,{bottom:!0,value:e.value,onKeyDown:e.onKeyDown,onKeyUp:e.onKeyUp,selectValueOnOpen:!1}):d(prompt(c,""))}function Ca(a){var b=Da(a)||[];if(!b.length)return[];var c=[];if(0===b[0]){for(var d=0;d<b.length;d++)"number"==typeof b[d]&&c.push(a.substring(b[d]+1,b[d+1]));return c}}function Da(a){for(var b=!1,c=[],d=0;d<a.length;d++){var e=a.charAt(d);b||"/"!=e||c.push(d),b=!b&&"\\"==e}return c}function Ea(a){for(var b="|(){",c="}",d=!1,e=[],f=-1;f<a.length;f++){var g=a.charAt(f)||"",h=a.charAt(f+1)||"",i=h&&-1!=b.indexOf(h);d?("\\"===g&&i||e.push(g),d=!1):"\\"===g?(d=!0,h&&-1!=c.indexOf(h)&&(i=!0),i&&"\\"!==h||e.push(g)):(e.push(g),i&&"\\"!==h&&e.push("\\"))}return e.join("")}function Fa(a){for(var b=!1,c=[],d=-1;d<a.length;d++){var e=a.charAt(d)||"",f=a.charAt(d+1)||"";Db[e+f]?(c.push(Db[e+f]),d++):b?(c.push(e),b=!1):"\\"===e?(b=!0,p(f)||"$"===f?c.push("$"):"/"!==f&&"\\"!==f&&c.push("\\")):("$"===e&&c.push("$"),c.push(e),"/"===f&&c.push("\\"))}return c.join("")}function Ga(b){for(var c=new a.StringStream(b),d=[];!c.eol();){for(;c.peek()&&"\\"!=c.peek();)d.push(c.next());var e=!1;for(var f in Eb)if(c.match(f,!0)){e=!0,d.push(Eb[f]);break}e||d.push(c.next())}return d.join("")}function Ha(a,b,c){var d=ub.registerController.getRegister("/");if(d.setText(a),a instanceof RegExp)return a;var e,f,g=Da(a);if(g.length){e=a.substring(0,g[0]);var h=a.substring(g[0]);f=-1!=h.indexOf("i")}else e=a;if(!e)return null;v("pcre")||(e=Ea(e)),c&&(b=/^[^A-Z]*$/.test(e));var i=new RegExp(e,b||f?"i":void 0);return i}function Ia(a,b){a.openNotification?a.openNotification('<span style="color: red">'+b+"</span>",{bottom:!0,duration:5e3}):alert(b)}function Ja(a,b){var c="";return a&&(c+='<span style="font-family: monospace">'+a+"</span>"),c+='<input type="text"/> <span style="color: #888">',b&&(c+='<span style="color: #888">',c+=b,c+="</span>"),c}function Ka(a,b){var c=(b.prefix||"")+" "+(b.desc||""),d=Ja(b.prefix,b.desc);Ba(a,d,c,b.onClose,b)}function La(a,b){if(a instanceof RegExp&&b instanceof RegExp){for(var c=["global","multiline","ignoreCase","source"],d=0;d<c.length;d++){var e=c[d];if(a[e]!==b[e])return!1}return!0}return!1}function Ma(a,b,c,d){if(b){var e=Aa(a),f=Ha(b,!!c,!!d);if(f)return Oa(a,f),La(f,e.getQuery())?f:(e.setQuery(f),f)}}function Na(a){if("^"==a.source.charAt(0))var b=!0;return{token:function(c){if(b&&!c.sol())return void c.skipToEnd();var d=c.match(a,!1);if(d)return 0==d[0].length?(c.next(),"searching"):c.sol()||(c.backUp(1),a.exec(c.next()+d[0]))?(c.match(a),"searching"):(c.next(),null);for(;!c.eol()&&(c.next(),!c.match(a,!1)););},query:a}}function Oa(a,b){var c=Aa(a),d=c.getOverlay();d&&b==d.query||(d&&a.removeOverlay(d),d=Na(b),a.addOverlay(d),a.showMatchesOnScrollbar&&(c.getScrollbarAnnotate()&&c.getScrollbarAnnotate().clear(),c.setScrollbarAnnotate(a.showMatchesOnScrollbar(b))),c.setOverlay(d))}function Pa(a,b,c,e){return void 0===e&&(e=1),a.operation(function(){for(var f=a.getCursor(),g=a.getSearchCursor(c,f),h=0;e>h;h++){var i=g.find(b);if(0==h&&i&&S(g.from(),f)&&(i=g.find(b)),!i&&(g=a.getSearchCursor(c,b?d(a.lastLine()):d(a.firstLine(),0)),!g.find(b)))return}return g.from()})}function Qa(a){var b=Aa(a);a.removeOverlay(Aa(a).getOverlay()),b.setOverlay(null),b.getScrollbarAnnotate()&&(b.getScrollbarAnnotate().clear(),b.setScrollbarAnnotate(null))}function Ra(a,b,c){return"number"!=typeof a&&(a=a.line),b instanceof Array?s(a,b):c?a>=b&&c>=a:a==b}function Sa(a){var b=a.getScrollInfo(),c=6,d=10,e=a.coordsChar({left:0,top:c+b.top},"local"),f=b.clientHeight-d+b.top,g=a.coordsChar({left:0,top:f},"local");return{top:e.line,bottom:g.line}}function Ta(b,c,d,e,f,g,h,i,j){function k(){b.operation(function(){for(;!p;)l(),m();n()})}function l(){var a=b.getRange(g.from(),g.to()),c=a.replace(h,i);g.replace(c)}function m(){for(;g.findNext()&&Ra(g.from(),e,f);)if(d||!q||g.from().line!=q.line)return b.scrollIntoView(g.from(),30),b.setSelection(g.from(),g.to()),q=g.from(),void(p=!1);p=!0}function n(a){if(a&&a(),b.focus(),q){b.setCursor(q);var c=b.state.vim;c.exMode=!1,c.lastHPos=c.lastHSPos=q.ch}j&&j()}function o(c,d,e){a.e_stop(c);var f=a.keyName(c);switch(f){case"Y":l(),m();break;case"N":m();break;case"A":var g=j;j=void 0,b.operation(k),j=g;break;case"L":l();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":n(e)}return p&&n(e),!0}b.state.vim.exMode=!0;var p=!1,q=g.from();return m(),p?void Ia(b,"No matches for "+h.source):c?void Ka(b,{prefix:"replace with <strong>"+i+"</strong> (y/n/a/q/l)",onKeyDown:o}):(k(),void(j&&j()))}function Ua(b){var c=b.state.vim,d=ub.macroModeState,e=ub.registerController.getRegister("."),f=d.isPlaying,g=d.lastInsertModeChanges,h=[];if(!f){for(var i=g.inVisualBlock?c.lastSelection.visualBlock.height:1,j=g.changes,h=[],k=0;k<j.length;)h.push(j[k]),j[k]instanceof db?k++:k+=i;g.changes=h,b.off("change",_a),a.off(b.getInputField(),"keydown",eb)}!f&&c.insertModeRepeat>1&&(fb(b,c,c.insertModeRepeat-1,!0),c.lastEditInputState.repeatOverride=c.insertModeRepeat),delete c.insertModeRepeat,c.insertMode=!1,b.setCursor(b.getCursor().line,b.getCursor().ch-1),b.setOption("keyMap","vim"),b.setOption("disableInput",!0),b.toggleOverwrite(!1),e.setText(g.changes.join("")),a.signal(b,"vim-mode-change",{mode:"normal"}),d.isRecording&&Za(d)}function Va(a){b.unshift(a)}function Wa(a,b,c,d,e){var f={keys:a,type:b};f[b]=c,f[b+"Args"]=d;for(var g in e)f[g]=e[g];Va(f)}function Xa(b,c,d,e){var f=ub.registerController.getRegister(e);if(":"==e)return f.keyBuffer[0]&&Ib.processCommand(b,f.keyBuffer[0]),void(d.isPlaying=!1);var g=f.keyBuffer,h=0;d.isPlaying=!0,d.replaySearchQueries=f.searchQueries.slice(0);for(var i=0;i<g.length;i++)for(var j,k,l=g[i];l;)if(j=/<\w+-.+?>|<\w+>|./.exec(l),k=j[0],l=l.substring(j.index+k.length),a.Vim.handleKey(b,k,"macro"),c.insertMode){var m=f.insertModeChanges[h++].changes;ub.macroModeState.lastInsertModeChanges.changes=m,
gb(b,m,1),Ua(b)}d.isPlaying=!1}function Ya(a,b){if(!a.isPlaying){var c=a.latestRegister,d=ub.registerController.getRegister(c);d&&d.pushText(b)}}function Za(a){if(!a.isPlaying){var b=a.latestRegister,c=ub.registerController.getRegister(b);c&&c.pushInsertModeChanges&&c.pushInsertModeChanges(a.lastInsertModeChanges)}}function $a(a,b){if(!a.isPlaying){var c=a.latestRegister,d=ub.registerController.getRegister(c);d&&d.pushSearchQuery&&d.pushSearchQuery(b)}}function _a(a,b){var c=ub.macroModeState,d=c.lastInsertModeChanges;if(!c.isPlaying)for(;b;){if(d.expectCursorActivityForChange=!0,"+input"==b.origin||"paste"==b.origin||void 0===b.origin){var e=b.text.join("\n");d.changes.push(e)}b=b.next}}function ab(a){var b=a.state.vim;if(b.insertMode){var c=ub.macroModeState;if(c.isPlaying)return;var d=c.lastInsertModeChanges;d.expectCursorActivityForChange?d.expectCursorActivityForChange=!1:d.changes=[]}else a.curOp.isVimOp||cb(a,b);b.visualMode&&bb(a)}function bb(a){var b=a.state.vim,c=J(a,R(b.sel.head)),d=L(c,0,1);b.fakeCursor&&b.fakeCursor.clear(),b.fakeCursor=a.markText(c,d,{className:"cm-animate-fat-cursor"})}function cb(b,c){var d=b.getCursor("anchor"),e=b.getCursor("head");if(c.visualMode&&!b.somethingSelected()?ia(b,!1):c.visualMode||c.insertMode||!b.somethingSelected()||(c.visualMode=!0,c.visualLine=!1,a.signal(b,"vim-mode-change",{mode:"visual"})),c.visualMode){var f=T(e,d)?0:-1,g=T(e,d)?-1:0;e=L(e,0,f),d=L(d,0,g),c.sel={anchor:d,head:e},ua(b,c,"<",U(e,d)),ua(b,c,">",V(e,d))}else c.insertMode||(c.lastHPos=b.getCursor().ch)}function db(a){this.keyName=a}function eb(b){function c(){return e.changes.push(new db(f)),!0}var d=ub.macroModeState,e=d.lastInsertModeChanges,f=a.keyName(b);f&&(-1!=f.indexOf("Delete")||-1!=f.indexOf("Backspace"))&&a.lookupKey(f,"vim-insert",c)}function fb(a,b,c,d){function e(){h?xb.processAction(a,b,b.lastEditActionCommand):xb.evalInput(a,b)}function f(c){if(g.lastInsertModeChanges.changes.length>0){c=b.lastEditActionCommand?c:1;var d=g.lastInsertModeChanges;gb(a,d.changes,c)}}var g=ub.macroModeState;g.isPlaying=!0;var h=!!b.lastEditActionCommand,i=b.inputState;if(b.inputState=b.lastEditInputState,h&&b.lastEditActionCommand.interlaceInsertRepeat)for(var j=0;c>j;j++)e(),f(1);else d||e(),f(c);b.inputState=i,b.insertMode&&!d&&Ua(a),g.isPlaying=!1}function gb(b,c,d){function e(c){return"string"==typeof c?a.commands[c](b):c(b),!0}var f=b.getCursor("head"),g=ub.macroModeState.lastInsertModeChanges.inVisualBlock;if(g){var h=b.state.vim,i=h.lastSelection,j=M(i.anchor,i.head);aa(b,f,j.line+1),d=b.listSelections().length,b.setCursor(f)}for(var k=0;d>k;k++){g&&b.setCursor(L(f,k,0));for(var l=0;l<c.length;l++){var m=c[l];if(m instanceof db)a.lookupKey(m.keyName,"vim-insert",e);else{var n=b.getCursor();b.replaceRange(m,n,n)}}}g&&b.setCursor(L(f,0,1))}a.defineOption("vimMode",!1,function(b,c,d){c&&"vim"!=b.getOption("keyMap")?b.setOption("keyMap","vim"):!c&&d!=a.Init&&/^vim/.test(b.getOption("keyMap"))&&b.setOption("keyMap","default")});var hb={Shift:"S",Ctrl:"C",Alt:"A",Cmd:"D",Mod:"A"},ib={Enter:"CR",Backspace:"BS",Delete:"Del"},jb=/[\d]/,kb=[a.isWordChar,function(b){return b&&!a.isWordChar(b)&&!/\s/.test(b)}],lb=[function(a){return/\S/.test(a)}],mb=l(65,26),nb=l(97,26),ob=l(48,10),pb=[].concat(mb,nb,ob,["<",">"]),qb=[].concat(mb,nb,ob,["-",'"',".",":","/"]),rb={};t("filetype",void 0,"string",["ft"],function(a,b){if(void 0!==b){if(void 0===a){var c=b.getOption("mode");return"null"==c?"":c}var c=""==a?"null":a;b.setOption("mode",c)}});var sb=function(){function a(a,b,h){function i(b){var e=++d%c,f=g[e];f&&f.clear(),g[e]=a.setBookmark(b)}var j=d%c,k=g[j];if(k){var l=k.find();l&&!S(l,b)&&i(b)}else i(b);i(h),e=d,f=d-c+1,0>f&&(f=0)}function b(a,b){d+=b,d>e?d=e:f>d&&(d=f);var h=g[(c+d)%c];if(h&&!h.find()){var i,j=b>0?1:-1,k=a.getCursor();do if(d+=j,h=g[(c+d)%c],h&&(i=h.find())&&!S(k,i))break;while(e>d&&d>f)}return h}var c=100,d=-1,e=0,f=0,g=new Array(c);return{cachedCursor:void 0,add:a,move:b}},tb=function(a){return a?{changes:a.changes,expectCursorActivityForChange:a.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var a=ub.macroModeState;a.onRecordingDone&&a.onRecordingDone(),a.onRecordingDone=void 0,a.isRecording=!1},enterMacroRecordMode:function(a,b){var c=ub.registerController.getRegister(b);c&&(c.clear(),this.latestRegister=b,a.openDialog&&(this.onRecordingDone=a.openDialog("(recording)["+b+"]",null,{bottom:!0})),this.isRecording=!0)}};var ub,vb,wb={buildKeyMap:function(){},getRegisterController:function(){return ub.registerController},resetVimGlobalState_:y,getVimGlobalState_:function(){return ub},maybeInitVimState_:x,suppressErrorLogging:!1,InsertModeKey:db,map:function(a,b,c){Ib.map(a,b,c)},setOption:u,getOption:v,defineOption:t,defineEx:function(a,b,c){if(b){if(0!==a.indexOf(b))throw new Error('(Vim.defineEx) "'+b+'" is not a prefix of "'+a+'", command not registered')}else b=a;Hb[a]=c,Ib.commandMap_[b]={name:a,shortName:b,type:"api"}},handleKey:function(a,b,c){var d=this.findKey(a,b,c);return"function"==typeof d?d():void 0},findKey:function(c,d,e){function f(){var a=ub.macroModeState;if(a.isRecording){if("q"==d)return a.exitMacroRecordMode(),A(c),!0;"mapping"!=e&&Ya(a,d)}}function g(){return"<Esc>"==d?(A(c),l.visualMode?ia(c):l.insertMode&&Ua(c),!0):void 0}function h(b){for(var e;b;)e=/<\w+-.+?>|<\w+>|./.exec(b),d=e[0],b=b.substring(e.index+d.length),a.Vim.handleKey(c,d,"mapping")}function i(){if(g())return!0;for(var a=l.inputState.keyBuffer=l.inputState.keyBuffer+d,e=1==d.length,f=xb.matchCommand(a,b,l.inputState,"insert");a.length>1&&"full"!=f.type;){var a=l.inputState.keyBuffer=a.slice(1),h=xb.matchCommand(a,b,l.inputState,"insert");"none"!=h.type&&(f=h)}if("none"==f.type)return A(c),!1;if("partial"==f.type)return vb&&window.clearTimeout(vb),vb=window.setTimeout(function(){l.insertMode&&l.inputState.keyBuffer&&A(c)},v("insertModeEscKeysTimeout")),!e;if(vb&&window.clearTimeout(vb),e){var i=c.getCursor();c.replaceRange("",L(i,0,-(a.length-1)),i,"+input")}return A(c),f.command}function j(){if(f()||g())return!0;var a=l.inputState.keyBuffer=l.inputState.keyBuffer+d;if(/^[1-9]\d*$/.test(a))return!0;var e=/^(\d*)(.*)$/.exec(a);if(!e)return A(c),!1;var h=l.visualMode?"visual":"normal",i=xb.matchCommand(e[2]||e[1],b,l.inputState,h);if("none"==i.type)return A(c),!1;if("partial"==i.type)return!0;l.inputState.keyBuffer="";var e=/^(\d*)(.*)$/.exec(a);return e[1]&&"0"!=e[1]&&l.inputState.pushRepeatDigit(e[1]),i.command}var k,l=x(c);return k=l.insertMode?i():j(),k===!1?void 0:k===!0?function(){}:function(){return c.operation(function(){c.curOp.isVimOp=!0;try{"keyToKey"==k.type?h(k.toKeys):xb.processCommand(c,l,k)}catch(b){throw c.state.vim=void 0,x(c),a.Vim.suppressErrorLogging||console.log(b),b}return!0})}},handleEx:function(a,b){Ib.processCommand(a,b)},defineMotion:F,defineAction:I,defineOperator:H,mapCommand:Wa,_mapCommand:Va,defineRegister:C,exitVisualMode:ia,exitInsertMode:Ua};z.prototype.pushRepeatDigit=function(a){this.operator?this.motionRepeat=this.motionRepeat.concat(a):this.prefixRepeat=this.prefixRepeat.concat(a)},z.prototype.getRepeat=function(){var a=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(a=1,this.prefixRepeat.length>0&&(a*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(a*=parseInt(this.motionRepeat.join(""),10))),a},B.prototype={setText:function(a,b,c){this.keyBuffer=[a||""],this.linewise=!!b,this.blockwise=!!c},pushText:function(a,b){b&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(a)},pushInsertModeChanges:function(a){this.insertModeChanges.push(tb(a))},pushSearchQuery:function(a){this.searchQueries.push(a)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},D.prototype={pushText:function(a,b,c,d,e){d&&"\n"==c.charAt(0)&&(c=c.slice(1)+"\n"),d&&"\n"!==c.charAt(c.length-1)&&(c+="\n");var f=this.isValidRegister(a)?this.getRegister(a):null;if(!f){switch(b){case"yank":this.registers[0]=new B(c,d,e);break;case"delete":case"change":-1==c.indexOf("\n")?this.registers["-"]=new B(c,d):(this.shiftNumericRegisters_(),this.registers[1]=new B(c,d))}return void this.unnamedRegister.setText(c,d,e)}var g=q(a);g?f.pushText(c,d):f.setText(c,d,e),this.unnamedRegister.setText(f.toString(),d)},getRegister:function(a){return this.isValidRegister(a)?(a=a.toLowerCase(),this.registers[a]||(this.registers[a]=new B),this.registers[a]):this.unnamedRegister},isValidRegister:function(a){return a&&s(a,qb)},shiftNumericRegisters_:function(){for(var a=9;a>=2;a--)this.registers[a]=this.getRegister(""+(a-1))}},E.prototype={nextMatch:function(a,b){var c=this.historyBuffer,d=b?-1:1;null===this.initialPrefix&&(this.initialPrefix=a);for(var e=this.iterator+d;b?e>=0:e<c.length;e+=d)for(var f=c[e],g=0;g<=f.length;g++)if(this.initialPrefix==f.substring(0,g))return this.iterator=e,f;return e>=c.length?(this.iterator=c.length,this.initialPrefix):0>e?a:void 0},pushInput:function(a){var b=this.historyBuffer.indexOf(a);b>-1&&this.historyBuffer.splice(b,1),a.length&&this.historyBuffer.push(a)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var xb={matchCommand:function(a,b,c,d){var e=N(a,b,d,c);if(!e.full&&!e.partial)return{type:"none"};if(!e.full&&e.partial)return{type:"partial"};for(var f,g=0;g<e.full.length;g++){var h=e.full[g];f||(f=h)}return"<character>"==f.keys.slice(-11)&&(c.selectedCharacter=P(a)),{type:"full",command:f}},processCommand:function(a,b,c){switch(b.inputState.repeatOverride=c.repeatOverride,c.type){case"motion":this.processMotion(a,b,c);break;case"operator":this.processOperator(a,b,c);break;case"operatorMotion":this.processOperatorMotion(a,b,c);break;case"action":this.processAction(a,b,c);break;case"search":this.processSearch(a,b,c);break;case"ex":case"keyToEx":this.processEx(a,b,c)}},processMotion:function(a,b,c){b.inputState.motion=c.motion,b.inputState.motionArgs=K(c.motionArgs),this.evalInput(a,b)},processOperator:function(a,b,c){var d=b.inputState;if(d.operator){if(d.operator==c.operator)return d.motion="expandToLine",d.motionArgs={linewise:!0},void this.evalInput(a,b);A(a)}d.operator=c.operator,d.operatorArgs=K(c.operatorArgs),b.visualMode&&this.evalInput(a,b)},processOperatorMotion:function(a,b,c){var d=b.visualMode,e=K(c.operatorMotionArgs);e&&d&&e.visualLine&&(b.visualLine=!0),this.processOperator(a,b,c),d||this.processMotion(a,b,c)},processAction:function(a,b,c){var d=b.inputState,e=d.getRepeat(),f=!!e,g=K(c.actionArgs)||{};d.selectedCharacter&&(g.selectedCharacter=d.selectedCharacter),c.operator&&this.processOperator(a,b,c),c.motion&&this.processMotion(a,b,c),(c.motion||c.operator)&&this.evalInput(a,b),g.repeat=e||1,g.repeatIsExplicit=f,g.registerName=d.registerName,A(a),b.lastMotion=null,c.isEdit&&this.recordLastEdit(b,d,c),Ab[c.action](a,g,b)},processSearch:function(b,c,d){function e(a,e,f){ub.searchHistoryController.pushInput(a),ub.searchHistoryController.reset();try{Ma(b,a,e,f)}catch(g){return Ia(b,"Invalid regex: "+a),void A(b)}xb.processMotion(b,c,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:d.searchArgs.toJumplist}})}function f(a){b.scrollTo(m.left,m.top),e(a,!0,!0);var c=ub.macroModeState;c.isRecording&&$a(c,a)}function g(c,d,e){var f,g=a.keyName(c);"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=ub.searchHistoryController.nextMatch(d,f)||"",e(d)):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&ub.searchHistoryController.reset();var h;try{h=Ma(b,d,!0,!0)}catch(c){}h?b.scrollIntoView(Pa(b,!i,h),30):(Qa(b),b.scrollTo(m.left,m.top))}function h(c,d,e){var f=a.keyName(c);"Esc"==f||"Ctrl-C"==f||"Ctrl-["==f||"Backspace"==f&&""==d?(ub.searchHistoryController.pushInput(d),ub.searchHistoryController.reset(),Ma(b,l),Qa(b),b.scrollTo(m.left,m.top),a.e_stop(c),A(b),e(),b.focus()):"Ctrl-U"==f&&(a.e_stop(c),e(""))}if(b.getSearchCursor){var i=d.searchArgs.forward,j=d.searchArgs.wholeWordOnly;Aa(b).setReversed(!i);var k=i?"/":"?",l=Aa(b).getQuery(),m=b.getScrollInfo();switch(d.searchArgs.querySrc){case"prompt":var n=ub.macroModeState;if(n.isPlaying){var o=n.replaySearchQueries.shift();e(o,!0,!1)}else Ka(b,{onClose:f,prefix:k,desc:Fb,onKeyUp:g,onKeyDown:h});break;case"wordUnderCursor":var p=ma(b,!1,!0,!1,!0),q=!0;if(p||(p=ma(b,!1,!0,!1,!1),q=!1),!p)return;var o=b.getLine(p.start.line).substring(p.start.ch,p.end.ch);o=q&&j?"\\b"+o+"\\b":Z(o),ub.jumpList.cachedCursor=b.getCursor(),b.setCursor(p.start),e(o,!0,!1)}}},processEx:function(b,c,d){function e(a){ub.exCommandHistoryController.pushInput(a),ub.exCommandHistoryController.reset(),Ib.processCommand(b,a)}function f(c,d,e){var f,g=a.keyName(c);("Esc"==g||"Ctrl-C"==g||"Ctrl-["==g||"Backspace"==g&&""==d)&&(ub.exCommandHistoryController.pushInput(d),ub.exCommandHistoryController.reset(),a.e_stop(c),A(b),e(),b.focus()),"Up"==g||"Down"==g?(f="Up"==g?!0:!1,d=ub.exCommandHistoryController.nextMatch(d,f)||"",e(d)):"Ctrl-U"==g?(a.e_stop(c),e("")):"Left"!=g&&"Right"!=g&&"Ctrl"!=g&&"Alt"!=g&&"Shift"!=g&&ub.exCommandHistoryController.reset()}"keyToEx"==d.type?Ib.processCommand(b,d.exArgs.input):c.visualMode?Ka(b,{onClose:e,prefix:":",value:"'<,'>",onKeyDown:f}):Ka(b,{onClose:e,prefix:":",onKeyDown:f})},evalInput:function(a,b){var c,e,f,g=b.inputState,h=g.motion,i=g.motionArgs||{},j=g.operator,k=g.operatorArgs||{},l=g.registerName,m=b.sel,n=R(b.visualMode?J(a,m.head):a.getCursor("head")),o=R(b.visualMode?J(a,m.anchor):a.getCursor("anchor")),p=R(n),q=R(o);if(j&&this.recordLastEdit(b,g),f=void 0!==g.repeatOverride?g.repeatOverride:g.getRepeat(),f>0&&i.explicitRepeat?i.repeatIsExplicit=!0:(i.noRepeat||!i.explicitRepeat&&0===f)&&(f=1,i.repeatIsExplicit=!1),g.selectedCharacter&&(i.selectedCharacter=k.selectedCharacter=g.selectedCharacter),i.repeat=f,A(a),h){var r=yb[h](a,n,i,b);if(b.lastMotion=yb[h],!r)return;if(i.toJumplist){var s=ub.jumpList,t=s.cachedCursor;t?(na(a,t,r),delete s.cachedCursor):na(a,n,r)}r instanceof Array?(e=r[0],c=r[1]):c=r,c||(c=R(n)),b.visualMode?(b.visualBlock&&c.ch===1/0||(c=J(a,c,b.visualBlock)),e&&(e=J(a,e,!0)),e=e||q,m.anchor=e,m.head=c,fa(a),ua(a,b,"<",T(e,c)?e:c),ua(a,b,">",T(e,c)?c:e)):j||(c=J(a,c),a.setCursor(c.line,c.ch))}if(j){if(k.lastSel){e=q;var u=k.lastSel,v=Math.abs(u.head.line-u.anchor.line),w=Math.abs(u.head.ch-u.anchor.ch);c=u.visualLine?d(q.line+v,q.ch):u.visualBlock?d(q.line+v,q.ch+w):u.head.line==u.anchor.line?d(q.line,q.ch+w):d(q.line+v,q.ch),b.visualMode=!0,b.visualLine=u.visualLine,b.visualBlock=u.visualBlock,m=b.sel={anchor:e,head:c},fa(a)}else b.visualMode&&(k.lastSel={anchor:R(m.anchor),head:R(m.head),visualBlock:b.visualBlock,visualLine:b.visualLine});var x,y,z,B,C;if(b.visualMode){if(x=U(m.head,m.anchor),y=V(m.head,m.anchor),z=b.visualLine||k.linewise,B=b.visualBlock?"block":z?"line":"char",C=ga(a,{anchor:x,head:y},B),z){var D=C.ranges;if("block"==B)for(var E=0;E<D.length;E++)D[E].head.ch=X(a,D[E].head.line);else"line"==B&&(D[0].head=d(D[0].head.line+1,0))}}else{if(x=R(e||q),y=R(c||p),T(y,x)){var F=x;x=y,y=F}z=i.linewise||k.linewise,z?ka(a,x,y):i.forward&&ja(a,x,y),B="char";var G=!i.inclusive||z;C=ga(a,{anchor:x,head:y},B,G)}a.setSelections(C.ranges,C.primary),b.lastMotion=null,k.repeat=f,k.registerName=l,k.linewise=z;var H=zb[j](a,k,C.ranges,q,c);b.visualMode&&ia(a,null!=H),H&&a.setCursor(H)}},recordLastEdit:function(a,b,c){var d=ub.macroModeState;d.isPlaying||(a.lastEditInputState=b,a.lastEditActionCommand=c,d.lastInsertModeChanges.changes=[],d.lastInsertModeChanges.expectCursorActivityForChange=!1)}},yb={moveToTopLine:function(a,b,c){var e=Sa(a).top+c.repeat-1;return d(e,la(a.getLine(e)))},moveToMiddleLine:function(a){var b=Sa(a),c=Math.floor(.5*(b.top+b.bottom));return d(c,la(a.getLine(c)))},moveToBottomLine:function(a,b,c){var e=Sa(a).bottom-c.repeat+1;return d(e,la(a.getLine(e)))},expandToLine:function(a,b,c){var e=b;return d(e.line+c.repeat-1,1/0)},findNext:function(a,b,c){var d=Aa(a),e=d.getQuery();if(e){var f=!c.forward;return f=d.isReversed()?!f:f,Oa(a,e),Pa(a,f,e,c.repeat)}},goToMark:function(a,b,c,d){var e=d.marks[c.selectedCharacter];if(e){var f=e.find();return c.linewise?{line:f.line,ch:la(a.getLine(f.line))}:f}return null},moveToOtherHighlightedEnd:function(a,b,c,e){if(e.visualBlock&&c.sameLine){var f=e.sel;return[J(a,d(f.anchor.line,f.head.ch)),J(a,d(f.head.line,f.anchor.ch))]}return[e.sel.head,e.sel.anchor]},jumpToMark:function(a,b,c,e){for(var f=b,g=0;g<c.repeat;g++){var h=f;for(var i in e.marks)if(n(i)){var j=e.marks[i].find(),k=c.forward?T(j,h):T(h,j);if(!(k||c.linewise&&j.line==h.line)){var l=S(h,f),m=c.forward?W(h,j,f):W(f,j,h);(l||m)&&(f=j)}}}return c.linewise&&(f=d(f.line,la(a.getLine(f.line)))),f},moveByCharacters:function(a,b,c){var e=b,f=c.repeat,g=c.forward?e.ch+f:e.ch-f;return d(e.line,g)},moveByLines:function(a,b,c,e){var f=b,g=f.ch;switch(e.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:g=e.lastHPos;break;default:e.lastHPos=g}var h=c.repeat+(c.repeatOffset||0),i=c.forward?f.line+h:f.line-h,j=a.firstLine(),k=a.lastLine();return j>i&&f.line==j||i>k&&f.line==k?void 0:(c.toFirstChar&&(g=la(a.getLine(i)),e.lastHPos=g),e.lastHSPos=a.charCoords(d(i,g),"div").left,d(i,g))},moveByDisplayLines:function(a,b,c,e){var f=b;switch(e.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:e.lastHSPos=a.charCoords(f,"div").left}var g=c.repeat,h=a.findPosV(f,c.forward?g:-g,"line",e.lastHSPos);if(h.hitSide)if(c.forward)var i=a.charCoords(h,"div"),j={top:i.top+8,left:e.lastHSPos},h=a.coordsChar(j,"div");else{var k=a.charCoords(d(a.firstLine(),0),"div");k.left=e.lastHSPos,h=a.coordsChar(k,"div")}return e.lastHPos=h.ch,h},moveByPage:function(a,b,c){var d=b,e=c.repeat;return a.findPosV(d,c.forward?e:-e,"page")},moveByParagraph:function(a,b,c){var d=c.forward?1:-1;return wa(a,b,c.repeat,d)},moveByScroll:function(a,b,c,d){var e=a.getScrollInfo(),f=null,g=c.repeat;g||(g=e.clientHeight/(2*a.defaultTextHeight()));var h=a.charCoords(b,"local");c.repeat=g;var f=yb.moveByDisplayLines(a,b,c,d);if(!f)return null;var i=a.charCoords(f,"local");return a.scrollTo(null,e.top+i.top-h.top),f},moveByWords:function(a,b,c){return ra(a,b,c.repeat,!!c.forward,!!c.wordEnd,!!c.bigWord)},moveTillCharacter:function(a,b,c){var d=c.repeat,e=sa(a,d,c.forward,c.selectedCharacter),f=c.forward?-1:1;return oa(f,c),e?(e.ch+=f,e):null},moveToCharacter:function(a,b,c){var d=c.repeat;return oa(0,c),sa(a,d,c.forward,c.selectedCharacter)||b},moveToSymbol:function(a,b,c){var d=c.repeat;return pa(a,d,c.forward,c.selectedCharacter)||b},moveToColumn:function(a,b,c,d){var e=c.repeat;return d.lastHPos=e-1,d.lastHSPos=a.charCoords(b,"div").left,ta(a,e)},moveToEol:function(a,b,c,e){var f=b;e.lastHPos=1/0;var g=d(f.line+c.repeat-1,1/0),h=a.clipPos(g);return h.ch--,e.lastHSPos=a.charCoords(h,"div").left,g},moveToFirstNonWhiteSpaceCharacter:function(a,b){var c=b;return d(c.line,la(a.getLine(c.line)))},moveToMatchedSymbol:function(a,b){var c,e=b,f=e.line,g=e.ch,h=a.getLine(f);do if(c=h.charAt(g++),c&&o(c)){var i=a.getTokenTypeAt(d(f,g));if("string"!==i&&"comment"!==i)break}while(c);if(c){var j=a.findMatchingBracket(d(f,g));return j.to}return e},moveToStartOfLine:function(a,b){return d(b.line,0)},moveToLineOrEdgeOfDocument:function(a,b,c){var e=c.forward?a.lastLine():a.firstLine();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=ub.lastChararacterSearch,e=c.repeat,f=c.forward===d.forward,g=(d.increment?1:0)*(f?-1:1);a.moveH(-g,"char"),c.inclusive=f?!0:!1;var h=sa(a,e,f,d.selectedCharacter);return h?(h.ch+=g,h):(a.moveH(g,"char"),b)}},zb={change:function(b,c,d){var e,f,g=b.state.vim;if(ub.macroModeState.lastInsertModeChanges.inVisualBlock=g.visualBlock,g.visualMode){f=b.getSelection();var h=G("",d.length);b.replaceSelections(h),e=U(d[0].head,d[0].anchor)}else{var i=d[0].anchor,j=d[0].head;f=b.getRange(i,j);var k=g.lastEditInputState||{};if("moveByWords"==k.motion&&!r(f)){var l=/\s+$/.exec(f);l&&k.motionArgs&&k.motionArgs.forward&&(j=L(j,0,-l[0].length),f=f.slice(0,-l[0].length))}var m=j.line-1==b.lastLine();b.replaceRange("",i,j),c.linewise&&!m&&(a.commands.newlineAndIndent(b),i.ch=null),e=i}ub.registerController.pushText(c.registerName,"change",f,c.linewise,d.length>1),Ab.enterInsertMode(b,{head:e},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=yb.moveToFirstNonWhiteSpaceCharacter(a,i))}return ub.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;f>=h;h++)for(var i=0;g>i;i++)a.indentLine(h,b.indentRight);return yb.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?yb.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 ub.registerController.pushText(b.registerName,"yank",f,b.linewise,e.visualBlock),g}},Ab={jumpListWalk:function(a,b,c){if(!c.visualMode){var d=b.repeat,e=b.forward,f=ub.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+1.4*h;break;case"top":g+=.4*h}a.scrollTo(null,g)},replayMacro:function(a,b,c){var d=b.selectedCharacter,e=b.repeat,f=ub.macroModeState;for("@"==d&&(d=f.latestRegister);e--;)Xa(a,c,f,d)},enterMacroRecordMode:function(a,b){var c=ub.macroModeState,d=b.selectedCharacter;c.enterMacroRecordMode(a,d)},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=yb.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("keyMap","vim-insert"),b.setOption("disableInput",!1),c&&c.replace?(b.toggleOverwrite(!0),b.setOption("keyMap","vim-replace"),a.signal(b,"vim-mode-change",{mode:"replace"})):(b.setOption("keyMap","vim-insert"),a.signal(b,"vim-mode-change",{mode:"insert"})),ub.macroModeState.isPlaying||(b.on("change",_a),a.on(b.getInputField(),"keydown",eb)),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=ub.registerController.getRegister(b.registerName),g=f.toString();if(g){if(b.matchIndent){var h=a.getOption("tabSize"),i=function(a){var b=a.split(" ").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(0>c)return"";if(a.getOption("indentWithTabs")){var d=Math.floor(c/h);return Array(d+1).join(" ")}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()),ub.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,fb(a,c,e,!1)}},exitInsertMode:Ua},Bb={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},Cb={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?!0:!1}},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 ub.query},setQuery:function(a){ub.query=a},getOverlay:function(){return this.searchOverlay},setOverlay:function(a){this.searchOverlay=a},isReversed:function(){return ub.isReversed},setReversed:function(a){ub.isReversed=a},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(a){this.annotate=a}};var Db={"\\n":"\n","\\r":"\r","\\t":" "},Eb={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":" "},Fb="(Javascript regexp)",Gb=function(){this.buildCommandMap_()};Gb.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=ub.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{Hb[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 a.getCursor().line;case"$":return a.lastLine();case"'":var d=a.state.vim.marks[b.next()];if(d&&d.find())return d.find().line;throw new Error("Mark not set");default:return void b.backUp(1)}},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)},user:!0};d&&(f.context=d),b.unshift(f)}else{var f={keys:a,type:"keyToKey",toKeys:c,user:!0};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&&b[f].user)return void b.splice(f,1);throw Error("No such mapping.")}};var Hb={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 Ib.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 Ib.unmap(d[0],c)},move:function(a,b){xb.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=rb[f]&&"boolean"==rb[f].type;if(i&&void 0==g&&(g=!0),!i&&void 0===g||h){var j=v(f,a,d);j===!0||j===!1?Ia(a," "+(j?"":"no")+f):Ia(a," "+f+"="+j)}else u(f,g,a,d)},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=ub.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),ub.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("!")&&(g=!0),b.eol())return;if(!b.eatSpace())return"Invalid arguments";var d=b.match(/[a-z]+/);if(d){d=d[0],h=-1!=d.indexOf("i"),i=-1!=d.indexOf("u");var e=-1!=d.indexOf("d")&&1,f=-1!=d.indexOf("x")&&1,k=-1!=d.indexOf("o")&&1;if(e+f+k>1)return"Invalid arguments";j=e&&"decimal"||f&&"hex"||k&&"octal"}if(b.match(/\/.*\//))return"patterns not supported"}}function f(a,b){if(g){var c;c=a,a=b,b=c}h&&(a=a.toLowerCase(),b=b.toLowerCase());var d=j&&q.exec(a),e=j&&q.exec(b);return d?(d=parseInt((d[1]+d[2]).toLowerCase(),r),e=parseInt((e[1]+e[2]).toLowerCase(),r),d-e):b>a?-1:1}var g,h,i,j,k=e();if(k)return void Ia(b,k+": "+c.argString);var l=c.line||b.firstLine(),m=c.lineEnd||c.line||b.lastLine();if(l!=m){var n=d(l,0),o=d(m,X(b,m)),p=b.getRange(n,o).split("\n"),q="decimal"==j?/(-?)([\d]+)/:"hex"==j?/(-?)(?:0x)?([0-9a-f]+)/i:"octal"==j?/([0-7]+)/:null,r="decimal"==j?10:"hex"==j?16:"octal"==j?8:null,s=[],t=[];if(j)for(var u=0;u<p.length;u++)q.exec(p[u])?s.push(p[u]):t.push(p[u]);else t=p;if(s.sort(f),t.sort(f),p=g?s.concat(t):t.concat(s),i){var v,w=p;p=[];for(var u=0;u<w.length;u++)w[u]!=v&&p.push(w[u]),v=w[u]}b.replaceRange(p.join("\n"),n,o)}},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;f>=m;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;Ib.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],void 0!==j&&(j=v("pcre")?Ga(j):Fa(j),ub.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&&(-1!=f.indexOf("c")&&(k=!0,f.replace("c","")),-1!=f.indexOf("g")&&(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||ub.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);Ta(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()},nohlsearch:function(a){Qa(a)},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;k-j>=l;l++){var m=String.fromCharCode(j+l);delete d.marks[m]}}else delete d.marks[g]}}},Ib=new Gb;return a.keyMap.vim={attach:h,detach:g,call:i},t("insertModeEscKeysTimeout",200,"number"),a.keyMap["vim-insert"]={"Ctrl-N":"autocomplete","Ctrl-P":"autocomplete",Enter:function(b){var c=a.commands.newlineAndIndentContinueComment||a.commands.newlineAndIndent;c(b)},fallthrough:["default"],attach:h,detach:g,call:i},a.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:h,detach:g,call:i},y(),wb};a.Vim=e()});
AnonSec - 2021 | Recode By D7net