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

Commit

Permalink
Merge pull request #11484 from sprintr/fix-pref-number-hints
Browse files Browse the repository at this point in the history
Convert numbers to strings, so StringMatch can match it.
  • Loading branch information
nethip committed Jul 27, 2015
2 parents 837392e + ff46a5f commit 273804e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/extensions/default/PrefsCodeHints/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 273804e

Please sign in to comment.