File Manager

Current Directory: /home/astoriaah/www/old15/media/editors/codemirror/addon/search
Viewing File: /home/astoriaah/www/old15/media/editors/codemirror/addon/search/match-highlighter.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";function e(t){"object"==typeof t&&(this.minChars=t.minChars,this.style=t.style,this.showToken=t.showToken,this.delay=t.delay,this.wordsOnly=t.wordsOnly),null==this.style&&(this.style=s),null==this.minChars&&(this.minChars=h),null==this.delay&&(this.delay=a),null==this.wordsOnly&&(this.wordsOnly=c),this.overlay=this.timeout=null}function i(t){var e=t.state.matchHighlighter;clearTimeout(e.timeout),e.timeout=setTimeout(function(){r(t)},e.delay)}function r(t){t.operation(function(){var e=t.state.matchHighlighter;if(e.overlay&&(t.removeOverlay(e.overlay),e.overlay=null),!t.somethingSelected()&&e.showToken){for(var i=e.showToken===!0?/[\w$]/:e.showToken,r=t.getCursor(),o=t.getLine(r.line),h=r.ch,s=h;h&&i.test(o.charAt(h-1));)--h;for(;s<o.length&&i.test(o.charAt(s));)++s;return void(s>h&&t.addOverlay(e.overlay=l(o.slice(h,s),i,e.style)))}var a=t.getCursor("from"),c=t.getCursor("to");if(a.line==c.line&&(!e.wordsOnly||n(t,a,c))){var u=t.getRange(a,c).replace(/^\s+|\s+$/g,"");u.length>=e.minChars&&t.addOverlay(e.overlay=l(u,!1,e.style))}})}function n(t,e,i){var r=t.getRange(e,i);if(null!==r.match(/^\w+$/)){if(e.ch>0){var n={line:e.line,ch:e.ch-1},o=t.getRange(n,e);if(null===o.match(/\W/))return!1}if(i.ch<t.getLine(e.line).length){var n={line:i.line,ch:i.ch+1},o=t.getRange(i,n);if(null===o.match(/\W/))return!1}return!0}return!1}function o(t,e){return!(t.start&&e.test(t.string.charAt(t.start-1))||t.pos!=t.string.length&&e.test(t.string.charAt(t.pos)))}function l(t,e,i){return{token:function(r){return!r.match(t)||e&&!o(r,e)?(r.next(),void(r.skipTo(t.charAt(0))||r.skipToEnd())):i}}}var h=2,s="matchhighlight",a=100,c=!1;t.defineOption("highlightSelectionMatches",!1,function(n,o,l){if(l&&l!=t.Init){var h=n.state.matchHighlighter.overlay;h&&n.removeOverlay(h),clearTimeout(n.state.matchHighlighter.timeout),n.state.matchHighlighter=null,n.off("cursorActivity",i)}o&&(n.state.matchHighlighter=new e(o),r(n),n.on("cursorActivity",i))})});