Merge pull request #3195 from areading314/ar/limit_autcomplete_elements

Limit length of GUI autocomplete to 1000
This commit is contained in:
Thomas Kluyver 2018-01-19 10:23:08 +00:00 committed by GitHub
commit 31215b857c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -306,7 +306,8 @@ define([
};
Completer.prototype.build_gui_list = function (completions) {
for (var i = 0; i < completions.length; ++i) {
var MAXIMUM_GUI_LIST_LENGTH = 1000;
for (var i = 0; i < completions.length && i < MAXIMUM_GUI_LIST_LENGTH; ++i) {
var opt = $('<option/>').text(completions[i].str).addClass(completions[i].type);
this.sel.append(opt);
}