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

[simplehint util] Support completeSingle option

To turn off the behavior where it'll always complete when only
a single option is left.
parent 49d96528
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,10 @@
editor.replaceRange(str, result.from, result.to);
}
// When there is only one completion, use it directly.
if (completions.length == 1) {insert(completions[0]); return true;}
if (options.completeSingle && completions.length == 1) {
insert(completions[0]);
return true;
}
// Build the select widget
var complete = document.createElement("div");
......@@ -92,6 +95,7 @@
};
CodeMirror.simpleHint.defaults = {
closeOnBackspace: true,
closeOnTokenChange: false
closeOnTokenChange: false,
completeSingle: true
};
})();
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