芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.9/vendor/codemirror/keymap/emacs.min.js
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var t=e.commands,n=e.Pos;function r(e,t){return e.line==t.line&&e.ch==t.ch}var a=[];function o(e){a.push(e),a.length>50&&a.shift()}function i(e){return a[a.length-(e?Math.min(e,1):1)]||""}var l=null;function c(e,t,n,i,c){null==c&&(c=e.getRange(t,n)),"grow"==i&&l&&l.cm==e&&r(t,l.pos)&&e.isClean(l.gen)?function(e){if(!a.length)return o(e);a[a.length-1]+=e}(c):!1!==i&&o(c),e.replaceRange("",t,n,"+delete"),l="grow"==i?{cm:e,pos:t,gen:e.changeGeneration()}:null}function s(e,t,n){return e.findPosH(t,n,"char",!0)}function u(e,t,n){return e.findPosH(t,n,"word",!0)}function d(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function f(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function p(e,t,r){for(var a=t.line,o=e.getLine(a),i=/\S/.test(r<0?o.slice(0,t.ch):o.slice(t.ch)),l=e.firstLine(),c=e.lastLine();;){if((a+=r)
c)return e.clipPos(n(a-r,r<0?0:null));if(o=e.getLine(a),/\S/.test(o))i=!0;else if(i)return n(a,0)}}function g(e,t,r){for(var a=t.line,o=t.ch,i=e.getLine(t.line),l=!1;;){var c=i.charAt(o+(r<0?-1:0));if(c){if(l&&/[!?.]/.test(c))return n(a,o+(r>0?1:0));l||(l=/\w/.test(c)),o+=r}else{if(a==(r<0?e.firstLine():e.lastLine()))return n(a,o);if(i=e.getLine(a+r),!/\S/.test(i))return n(a,o);a+=r,o=r<0?i.length:0}}}function C(e,t,a){var o;if(e.findMatchingBracket&&(o=e.findMatchingBracket(t,{strict:!0}))&&o.match&&(o.forward?1:-1)==a)return a>0?n(o.to.line,o.to.ch+1):o.to;for(var i=!0;;i=!1){var l=e.getTokenAt(t),c=n(t.line,a<0?l.start:l.end);if(!(i&&a>0&&l.end==t.ch)&&/\w/.test(l.string))return c;var s=e.findPosH(c,a,"char");if(r(c,s))return t;t=s}}function h(e,t){var n=e.state.emacsPrefix;return n?(L(e),"-"==n?-1:Number(n)):t?null:1}function w(e){var t="string"==typeof e?function(t){t.execCommand(e)}:e;return function(e){var n=h(e);t(e);for(var r=1;r
1&&"+input"==t.origin){for(var r=t.text.join("\n"),a="",o=1;o
1&&a.pop(),i()),"around","paste")},t.forwardChar=k(s,1),t.backwardChar=k(s,-1),t.deleteChar=function(e){S(e,s,1,!1)},t.deleteForwardChar=function(e){v(e,!1)||S(e,s,1,!1)},t.deleteBackwardChar=function(e){v(e,!1)||S(e,s,-1,!1)},t.forwardWord=k(u,1),t.backwardWord=k(u,-1),t.killWord=function(e){S(e,u,1,"grow")},t.backwardKillWord=function(e){S(e,u,-1,"grow")},t.nextLine=k(d,1),t.previousLine=k(d,-1),t.scrollDownCommand=k(f,1),t.scrollUpCommand=k(f,-1),t.backwardParagraph=k(p,-1),t.forwardParagraph=k(p,1),t.backwardSentence=k(g,-1),t.forwardSentence=k(g,1),t.killSentence=function(e){S(e,g,1,"grow")},t.backwardKillSentence=function(e){c(e,e.getCursor(),g(e,e.getCursor(),1),"grow")},t.killSexp=function(e){S(e,C,1,"grow")},t.backwardKillSexp=function(e){S(e,C,-1,"grow")},t.forwardSexp=k(C,1),t.backwardSexp=k(C,-1),t.markSexp=function(e){var t=e.getCursor();e.setSelection(m(e,t,C,1),t)},t.transposeSexps=function(e){var t=C(e,e.getCursor(),-1),n=C(e,t,1),r=C(e,n,1),a=C(e,r,-1);e.replaceRange(e.getRange(a,r)+e.getRange(n,a)+e.getRange(t,n),t,r)},t.backwardUpList=w((function(e){for(var t=e.getCursor(),r=t.line,a=t.ch,o=[];r>=e.firstLine();){for(var i=e.getLine(r),l=null==a?i.length:a;l>0;){if(")"==(a=i.charAt(--l)))o.push("(");else if("]"==a)o.push("[");else if("}"==a)o.push("{");else if(/[\(\{\[]/.test(a)&&(!o.length||o.pop()!=a))return e.extendSelection(n(r,l))}--r,a=null}})),t.justOneSpace=function(e){for(var t=e.getCursor(),r=t.ch,a=t.ch,o=e.getLine(t.line);r&&/\s/.test(o.charAt(r-1));)--r;for(;a
0)return e.setCursor(t-1);W(e,"Goto line",(function(t){var n;t&&!isNaN(n=Number(t))&&n==(0|n)&&n>0&&e.setCursor(n-1)}))},t.indentRigidly=function(e){e.indentSelection(h(e,!0)||e.getOption("indentUnit"))},t.exchangePointAndMark=function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},t.quotedInsertTab=w("insertTab"),t.universalArgument=function(e){e.state.emacsPrefixMap=!0,e.addKeyMap(D),e.on("keyHandled",R),e.on("inputRead",R)},e.emacs={kill:c,killRegion:v,repeated:w};var M=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":"killRegion","Ctrl-K":"killLineEmacs","Alt-W":"killRingSave","Ctrl-Y":"yank","Alt-Y":"yankPop","Ctrl-Space":"setMark","Ctrl-Shift-2":"setMark","Ctrl-F":"forwardChar","Ctrl-B":"backwardChar",Right:"forwardChar",Left:"backwardChar","Ctrl-D":"deleteChar",Delete:"deleteForwardChar","Ctrl-H":"deleteBackwardChar",Backspace:"deleteBackwardChar","Alt-F":"forwardWord","Alt-B":"backwardWord","Alt-Right":"forwardWord","Alt-Left":"backwardWord","Alt-D":"killWord","Alt-Backspace":"backwardKillWord","Ctrl-N":"nextLine","Ctrl-P":"previousLine",Down:"nextLine",Up:"previousLine","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":"scrollDownCommand","Ctrl-V":"scrollUpCommand",PageUp:"scrollUpCommand",PageDown:"scrollDownCommand","Ctrl-Up":"backwardParagraph","Ctrl-Down":"forwardParagraph","Alt-{":"backwardParagraph","Alt-}":"forwardParagraph","Alt-A":"backwardSentence","Alt-E":"forwardSentence","Alt-K":"killSentence","Ctrl-X Delete":"backwardKillSentence","Ctrl-Alt-K":"killSexp","Ctrl-Alt-Backspace":"backwardKillSexp","Ctrl-Alt-F":"forwardSexp","Ctrl-Alt-B":"backwardSexp","Shift-Ctrl-Alt-2":"markSexp","Ctrl-Alt-T":"transposeSexps","Ctrl-Alt-U":"backwardUpList","Alt-Space":"justOneSpace","Ctrl-O":"openLine","Ctrl-T":"transposeCharsRepeatable","Alt-C":"capitalizeWord","Alt-U":"upcaseWord","Alt-L":"downcaseWord","Alt-;":"toggleComment","Ctrl-/":"undoRepeatable","Shift-Ctrl--":"undoRepeatable","Ctrl-Z":"undoRepeatable","Cmd-Z":"undoRepeatable","Ctrl-X U":"undoRepeatable","Shift-Ctrl-Z":"redo","Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findPersistentNext","Ctrl-R":"findPersistentPrev","Ctrl-G":"keyboardQuit","Shift-Alt-5":"replace","Alt-/":"autocomplete",Enter:"newlineAndIndent","Ctrl-J":"newline",Tab:"indentAuto","Alt-G G":"gotoLine","Ctrl-X Tab":"indentRigidly","Ctrl-X Ctrl-X":"exchangePointAndMark","Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X K":"close","Ctrl-X H":"selectAll","Ctrl-Q Tab":"quotedInsertTab","Ctrl-U":"universalArgument",fallthrough:"default"}),D={"Ctrl-G":L};function E(e){D[e]=function(t){A(t,e)},M["Ctrl-"+e]=function(t){A(t,e)},b["Ctrl-"+e]=!0}for(var K=0;K<10;++K)E(String(K));E("-")}));