Skip to content
Snippets Groups Projects
Commit 68d4632f authored by Marijn Haverbeke's avatar Marijn Haverbeke
Browse files

[show-hint addon] Default to hinting with anyword, when nothing else is found

(Only works if anyword-hint.js is loaded.)
parent b1aa60ef
No related branches found
No related tags found
No related merge requests found
......@@ -309,15 +309,16 @@
};
CodeMirror.registerHelper("hint", "auto", function(cm, options) {
var helpers = cm.getHelpers(cm.getCursor(), "hint");
var helpers = cm.getHelpers(cm.getCursor(), "hint"), words;
if (helpers.length) {
for (var i = 0; i < helpers.length; i++) {
var cur = helpers[i](cm, options);
if (cur && cur.list.length) return cur;
}
} else {
var words = cm.getHelper(cm.getCursor(), "hintWords");
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
if (words) return CodeMirror.hint.fromList(cm, {words: words});
} else if (CodeMirror.hint.anyword) {
return CodeMirror.hint.anyword(cm, options);
}
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment