From 2af9c562792a807f8f3f203f4f67ef8141b4a8fe Mon Sep 17 00:00:00 2001 From: Marcel Gerber Date: Fri, 5 Dec 2014 15:01:20 +0100 Subject: [PATCH] Fixup of maxCodeHints pref --- src/editor/CodeHintList.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/editor/CodeHintList.js b/src/editor/CodeHintList.js index 28fc611ba62..7912b9145b2 100644 --- a/src/editor/CodeHintList.js +++ b/src/editor/CodeHintList.js @@ -44,7 +44,7 @@ define(function (require, exports, module) { * @constructor * @param {Editor} editor * @param {boolean} insertHintOnTab Whether pressing tab inserts the selected hint - * @param {number} maxResults Maximum hints displayed at once. Defaults to 1000 + * @param {number} maxResults Maximum hints displayed at once. Defaults to 50 */ function CodeHintList(editor, insertHintOnTab, maxResults) { @@ -67,10 +67,7 @@ define(function (require, exports, module) { * * @type {number} */ - this.maxResults = Math.min( - (maxResults > 0 && ValidationUtils.isInteger(maxResults) && maxResults) || 1000, - 1000 - ); + this.maxResults = ValidationUtils.isIntegerInRange(maxResults, 1, 1000) ? maxResults : 50; /** * Is the list currently open?