vendor/assets/javascripts/codemirror/addons/hint/anyword-hint.js in codemirror-rails-4.8 vs vendor/assets/javascripts/codemirror/addons/hint/anyword-hint.js in codemirror-rails-4.9
- old
+ new
@@ -15,11 +15,10 @@
CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
var word = options && options.word || WORD;
var range = options && options.range || RANGE;
var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
- var start = cur.ch, end = start;
- while (end < curLine.length && word.test(curLine.charAt(end))) ++end;
+ var end = cur.ch, start = end;
while (start && word.test(curLine.charAt(start - 1))) --start;
var curWord = start != end && curLine.slice(start, end);
var list = [], seen = {};
var re = new RegExp(word.source, "g");