CodeMirror.simpleHint=function(e,t,o){function n(i){function l(t){e.replaceRange(t,a.from,a.to)}function d(){C||(C=!0,f.parentNode.removeChild(f))}function c(){l(u[p.selectedIndex]),d(),setTimeout(function(){e.focus()},50)}if(!e.somethingSelected()){var s=e.getTokenAt(e.getCursor());if(!r.closeOnTokenChange||null==i||s.start==i.start&&s.type==i.type){var a=t(e,o);if(a&&a.list.length){var u=a.list;if(r.completeSingle&&1==u.length)return l(u[0]),!0;var f=document.createElement("div");f.className="CodeMirror-completions";var p=f.appendChild(document.createElement("select"));window.opera||(p.multiple=!0);for(var m=0;m<u.length;++m){p.appendChild(document.createElement("option")).appendChild(document.createTextNode(u[m]))}p.firstChild.selected=!0,p.size=Math.min(10,u.length);var h=e.cursorCoords(r.alignWithWord?a.from:null);f.style.left=h.left+"px",f.style.top=h.bottom+"px",document.body.appendChild(f);(window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth))-h.left<p.clientWidth&&(f.style.left=h.left-p.clientWidth+"px"),u.length<=10&&(f.style.width=p.clientWidth-1+"px");var C=!1;return CodeMirror.on(p,"blur",d),CodeMirror.on(p,"keydown",function(t){var o=t.keyCode;13==o?(CodeMirror.e_stop(t),c()):27==o?(CodeMirror.e_stop(t),d(),e.focus()):38==o||40==o||33==o||34==o||CodeMirror.isModifierKey(t)||(d(),e.focus(),e.triggerOnKeyDown(t),r.closeOnBackspace&&8==o||setTimeout(function(){n(s)},50))}),CodeMirror.on(p,"dblclick",c),p.focus(),window.opera&&setTimeout(function(){C||p.focus()},100),!0}}}}var r={},i=CodeMirror.simpleHint.defaults;for(var l in i)i.hasOwnProperty(l)&&(r[l]=(o&&o.hasOwnProperty(l)?o:i)[l]);return n()},CodeMirror.simpleHint.defaults={closeOnBackspace:!0,closeOnTokenChange:!1,completeSingle:!0,alignWithWord:!0};