芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.8/vendor/codemirror/addon/edit/closebrackets.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){var n={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},t=e.Pos;function r(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:n[t]}e.defineOption("autoCloseBrackets",!1,(function(n,t,o){o&&o!=e.Init&&(n.removeKeyMap(i),n.state.closeBrackets=null),t&&(a(r(t,"pairs")),n.state.closeBrackets=t,n.addKeyMap(i))}));var i={Backspace:function(n){var i=s(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var a=r(i,"pairs"),o=n.listSelections(),l=0;l
=0;l--){var h=o[l].head;n.replaceRange("",t(h.line,h.ch-1),t(h.line,h.ch+1),"+delete")}},Enter:function(n){var t=s(n),i=t&&r(t,"explode");if(!i||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),o=0;o
1&&p.indexOf(i)>=0&&n.getRange(t(y.line,y.ch-2),y)==i+i){if(y.ch>2&&/\bstring/.test(n.getTokenTypeAt(t(y.line,y.ch-2))))return e.Pass;S="addFour"}else if(g){var m=0==y.ch?" ":n.getRange(t(y.line,y.ch-1),y);if(e.isWordChar(O)||m==i||e.isWordChar(m))return e.Pass;S="both"}else{if(!b||!(0===O.length||/\s/.test(O)||d.indexOf(O)>-1))return e.Pass;S="both"}else S=g&&h(n,y)?"both":p.indexOf(i)>=0&&n.getRange(y,t(y.line,y.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=S)return e.Pass}else u=S}var x=f%2?o.charAt(f-1):i,A=f%2?i:o.charAt(f+1);n.operation((function(){if("skip"==u)l(n,1);else if("skipThree"==u)l(n,3);else if("surround"==u){for(var e=n.getSelections(),t=0;t
0?{line:o.head.line,ch:o.head.ch+n}:{line:o.head.line-1};t.push({anchor:s,head:s})}e.setSelections(t,i)}function c(n){var r=e.cmpPos(n.anchor,n.head)>0;return{anchor:new t(n.anchor.line,n.anchor.ch+(r?-1:1)),head:new t(n.head.line,n.head.ch+(r?1:-1))}}function f(e,n){var r=e.getRange(t(n.line,n.ch-1),t(n.line,n.ch+1));return 2==r.length?r:null}function h(e,n){var r=e.getTokenAt(t(n.line,n.ch+1));return/\bstring/.test(r.type)&&r.start==n.ch&&(0==n.ch||!/\bstring/.test(e.getTokenTypeAt(n)))}a(n.pairs+"`")}));