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