Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit ff46a5f

Browse files
committed
Convert numbers to strings, so StringMatch can match it.
1 parent 00123c4 commit ff46a5f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • src/extensions/default/PrefsCodeHints

src/extensions/default/PrefsCodeHints/main.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,13 @@ define(function (require, exports, module) {
281281
return null;
282282
}
283283

284+
// Convert integers to strings, so StringMatch.stringMatch can match it.
285+
if (option.type === "number" || option.valueType === "number") {
286+
values = values.map(function (val) {
287+
return val.toString();
288+
});
289+
}
290+
284291
// filter through the values.
285292
hints = $.map(values, function (value) {
286293
var match = StringMatch.stringMatch(value, query, stringMatcherOptions);
@@ -332,8 +339,7 @@ define(function (require, exports, module) {
332339
}
333340

334341
// Put quotes around completion.
335-
completion = quoteChar + completion;
336-
completion = completion + quoteChar;
342+
completion = quoteChar + completion + quoteChar;
337343

338344
// Append colon and braces, brackets and quotes.
339345
if (!ctxInfo.shouldReplace) {

0 commit comments

Comments
 (0)