From ff46a5fdae9e4d17c5628b00af3c7089a31f6bcf Mon Sep 17 00:00:00 2001 From: Amin Ullah Khan Date: Sun, 26 Jul 2015 17:40:59 +0500 Subject: [PATCH] Convert numbers to strings, so StringMatch can match it. --- src/extensions/default/PrefsCodeHints/main.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/extensions/default/PrefsCodeHints/main.js b/src/extensions/default/PrefsCodeHints/main.js index 367f6f5a0b9..7a210106f25 100644 --- a/src/extensions/default/PrefsCodeHints/main.js +++ b/src/extensions/default/PrefsCodeHints/main.js @@ -281,6 +281,13 @@ define(function (require, exports, module) { return null; } + // Convert integers to strings, so StringMatch.stringMatch can match it. + if (option.type === "number" || option.valueType === "number") { + values = values.map(function (val) { + return val.toString(); + }); + } + // filter through the values. hints = $.map(values, function (value) { var match = StringMatch.stringMatch(value, query, stringMatcherOptions); @@ -332,8 +339,7 @@ define(function (require, exports, module) { } // Put quotes around completion. - completion = quoteChar + completion; - completion = completion + quoteChar; + completion = quoteChar + completion + quoteChar; // Append colon and braces, brackets and quotes. if (!ctxInfo.shouldReplace) {