(function(a){"object"==typeof exports&&"object"==typeof module?a(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){var q=/[\w$]+/;a.registerHelper("hint","anyword",function(k,b){for(var l=b&&b.word||q,r=b&&b.range||500,c=k.getCursor(),d=k.getLine(c.line),m=c.ch,e=m;e&&l.test(d.charAt(e-1));)--e;for(var d=e!=m&&d.slice(e,m),n=b&&b.list||[],p={},l=new RegExp(l.source,"g"),f=-1;1>=f;f+=2)for(var g=c.line,t=Math.min(Math.max(g+
f*r,k.firstLine()),k.lastLine())+f;g!=t;g+=f)for(var u=k.getLine(g),h;h=l.exec(u);)g==c.line&&h[0]===d||d&&0!=h[0].lastIndexOf(d,0)||Object.prototype.hasOwnProperty.call(p,h[0])||(p[h[0]]=!0,n.push(h[0]));return{list:n,from:a.Pos(c.line,e),to:a.Pos(c.line,m)}})});