ace.define("ace/occur",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/edit_session","ace/search_highlight","ace/lib/dom"],function(r,e,m){"use strict";var o=r("./lib/oop");var R=r("./range").Range;var S=r("./search").Search;var E=r("./edit_session").EditSession;var a=r("./search_highlight").SearchHighlight;function O(){}o.inherits(O,S);(function(){this.enter=function(b,c){if(!c.needle)return false;var p=b.getCursorPosition();this.displayOccurContent(b,c);var t=this.originalToOccurPosition(b.session,p);b.moveCursorToPosition(t);return true;};this.exit=function(b,c){var p=c.translatePosition&&b.getCursorPosition();var t=p&&this.occurToOriginalPosition(b.session,p);this.displayOriginalContent(b);if(t)b.moveCursorToPosition(t);return true;};this.highlight=function(s,b){var h=s.$occurHighlight=s.$occurHighlight||s.addDynamicMarker(new a(null,"ace_occur-highlight","text"));h.setRegexp(b);s._emit("changeBackMarker");};this.displayOccurContent=function(b,c){this.$originalSession=b.session;var f=this.matchingLines(b.session,c);var l=f.map(function(h){return h.content;});var g=new E(l.join('\n'));g.$occur=this;g.$occurMatchingLines=f;b.setSession(g);this.$useEmacsStyleLineStart=this.$originalSession.$useEmacsStyleLineStart;g.$useEmacsStyleLineStart=this.$useEmacsStyleLineStart;this.highlight(g,c.re);g._emit('changeBackMarker');};this.displayOriginalContent=function(b){b.setSession(this.$originalSession);this.$originalSession.$useEmacsStyleLineStart=this.$useEmacsStyleLineStart;};this.originalToOccurPosition=function(s,p){var l=s.$occurMatchingLines;var n={row:0,column:0};if(!l)return n;for(var i=0;i30)this.$data.shift();},append:function(c){var i=this.$data.length-1;var e=this.$data[i]||"";if(c)e+=c;if(e)this.$data[i]=e;},get:function(n){n=n||1;return this.$data.slice(this.$data.length-n,this.$data.length).reverse().join('\n');},pop:function(){if(this.$data.length>1)this.$data.pop();return this.get();},rotate:function(){this.$data.unshift(this.$data.pop());return this.get();}};});