芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media/vendor/codemirror/addon/search/searchcursor.min.js
!function(t){"object"==typeof exports&&"object"==typeof module?t(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],t):t(CodeMirror)}((function(t){"use strict";var n,e,r=t.Pos;function i(t,n){for(var e=function(t){var n=t.flags;return null!=n?n:(t.ignoreCase?"i":"")+(t.global?"g":"")+(t.multiline?"m":"")}(t),r=e,i=0;i
c);u++){var a=t.getLine(f++);h=null==h?a:h+"\n"+a}s*=2,n.lastIndex=e.ch;var g=n.exec(h);if(g){var m=h.slice(0,g.index).split("\n"),d=g[0].split("\n"),v=e.line+m.length-1,p=m[m.length-1].length;return{from:r(v,p),to:r(v+d.length-1,1==d.length?p+d[0].length:d[d.length-1].length),match:g}}}}function s(t,n,e){for(var r,i=0;i<=t.length;){n.lastIndex=i;var o=n.exec(t);if(!o)break;var l=o.index+o[0].length;if(l>t.length-e)break;(!r||l>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function f(t,n,e){n=i(n,"g");for(var o=e.line,l=e.ch,h=t.firstLine();o>=h;o--,l=-1){var f=t.getLine(o),c=s(f,n,l<0?0:f.length-l);if(c)return{from:r(o,c.index),to:r(o,c.index+c[0].length),match:c}}}function c(t,n,e){if(!o(n))return f(t,n,e);n=i(n,"gm");for(var l,h=1,c=t.getLine(e.line).length-e.ch,u=e.line,a=t.firstLine();u>=a;){for(var g=0;g
=a;g++){var m=t.getLine(u--);l=null==l?m:m+"\n"+l}h*=2;var d=s(l,n,c);if(d){var v=l.slice(0,d.index).split("\n"),p=d[0].split("\n"),x=u+v.length,L=v[v.length-1].length;return{from:r(x,L),to:r(x+p.length-1,1==p.length?L+p[0].length:p[p.length-1].length),match:d}}}}function u(t,n,e,r){if(t.length==n.length)return e;for(var i=0,o=e+Math.max(0,t.length-n.length);;){if(i==o)return i;var l=i+o>>1,h=r(t.slice(0,l)).length;if(h==e)return l;h>e?o=l:i=l+1}}function a(t,i,o,l){if(!i.length)return null;var h=l?n:e,s=h(i).split(/\r|\n\r?/);t:for(var f=o.line,c=o.ch,a=t.lastLine()+1-s.length;f<=a;f++,c=0){var g=t.getLine(f).slice(c),m=h(g);if(1==s.length){var d=m.indexOf(s[0]);if(-1==d)continue t;o=u(g,m,d,h)+c;return{from:r(f,u(g,m,d,h)+c),to:r(f,u(g,m,d+s[0].length,h)+c)}}var v=m.length-s[0].length;if(m.slice(v)==s[0]){for(var p=1;p
=a;f--,c=-1){var g=t.getLine(f);c>-1&&(g=g.slice(0,c));var m=h(g);if(1==s.length){var d=m.lastIndexOf(s[0]);if(-1==d)continue t;return{from:r(f,u(g,m,d,h)),to:r(f,u(g,m,d+s[0].length,h))}}var v=s[s.length-1];if(m.slice(0,v.length)==v){var p=1;for(o=f-s.length+1;p
0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}));