mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 17:42:27 +01:00
Dont lower-case completion strings.
This commit is contained in:
@@ -95,10 +95,9 @@ liberator.Completion = function () //{{{
|
|||||||
: [item[0]];
|
: [item[0]];
|
||||||
for (let [,compitem] in Iterator(complist))
|
for (let [,compitem] in Iterator(complist))
|
||||||
{
|
{
|
||||||
if (ignorecase)
|
let str = !ignorecase ? compitem : String(compitem).toLowerCase();
|
||||||
compitem = String.toLowerCase(compitem);
|
|
||||||
|
|
||||||
if (compitem.indexOf(filter) == -1)
|
if (str.indexOf(filter) == -1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
filtered.push([compitem, item[1], favicon ? item[2] : null]);
|
filtered.push([compitem, item[1], favicon ? item[2] : null]);
|
||||||
@@ -106,9 +105,9 @@ liberator.Completion = function () //{{{
|
|||||||
if (longest)
|
if (longest)
|
||||||
{
|
{
|
||||||
if (substrings.length == 0)
|
if (substrings.length == 0)
|
||||||
buildSubstrings(compitem, filter);
|
buildSubstrings(str, filter);
|
||||||
else
|
else
|
||||||
substrings = substrings.filter(function (s) compitem.indexOf(s) >= 0);
|
substrings = substrings.filter(function (s) str.indexOf(s) >= 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -854,6 +854,7 @@ lookup:
|
|||||||
catch (e)
|
catch (e)
|
||||||
{
|
{
|
||||||
let message = "Sourcing file: " + file.path + ": " + e;
|
let message = "Sourcing file: " + file.path + ": " + e;
|
||||||
|
if (Components.utils.reportError)
|
||||||
Components.utils.reportError(message);
|
Components.utils.reportError(message);
|
||||||
if (!silent)
|
if (!silent)
|
||||||
liberator.echoerr(message);
|
liberator.echoerr(message);
|
||||||
|
|||||||
@@ -161,6 +161,11 @@ liberator.util = { //{{{
|
|||||||
return str.replace(/([\\{}()[\].?*+])/g, "\\$1");
|
return str.replace(/([\\{}()[\].?*+])/g, "\\$1");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
escapeString: function (str)
|
||||||
|
{
|
||||||
|
return '"' + str.replace(/([\\'])/g, "\\$1") + '"';
|
||||||
|
},
|
||||||
|
|
||||||
// Flatten an array:
|
// Flatten an array:
|
||||||
// [["foo", "bar"], ["baz"]] -> ["foo", "bar", "baz"]
|
// [["foo", "bar"], ["baz"]] -> ["foo", "bar", "baz"]
|
||||||
flatten: function (ary)
|
flatten: function (ary)
|
||||||
|
|||||||
Reference in New Issue
Block a user