diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js
index 1ce6ee11..388b8f20 100644
--- a/common/content/bookmarks.js
+++ b/common/content/bookmarks.js
@@ -38,7 +38,7 @@ var Bookmarks = Module("bookmarks", {
get format() ({
anchored: false,
title: ["URL", "Info"],
- keys: { text: "url", description: "title", icon: "icon", extra: "extra", tags: "tags" },
+ keys: { text: "url", description: "title", icon: "icon", extra: "extra", tags: "tags", isURI: function () true },
process: [template.icon, template.bookmarkDescription]
}),
diff --git a/common/content/commandline.js b/common/content/commandline.js
index cae99423..53f9686c 100644
--- a/common/content/commandline.js
+++ b/common/content/commandline.js
@@ -1343,8 +1343,8 @@ var CommandLine = Module("commandline", {
arg = dactyl.userEval(arg);
if (isObject(arg))
arg = util.objectToString(arg, useColor);
- else
- arg = String(arg);
+ else if (!isString(arg) && useColor)
+ arg = template.highlight(arg);
return arg;
}
}, {
diff --git a/common/modules/completion.jsm b/common/modules/completion.jsm
index 9671e95a..72147810 100644
--- a/common/modules/completion.jsm
+++ b/common/modules/completion.jsm
@@ -469,7 +469,7 @@ var CompletionContext = Class("CompletionContext", {
this.processor = Array.slice(this.process);
if (!this.anchored)
this.processor[0] = function (item, text) self.process[0].call(self, item,
- template.highlightFilter(item.text, self.filter));
+ template.highlightFilter(item.text, self.filter, null, item.isURI));
try {
// Item prototypes
diff --git a/common/modules/template.jsm b/common/modules/template.jsm
index 9cd617c6..17ccb9df 100644
--- a/common/modules/template.jsm
+++ b/common/modules/template.jsm
@@ -273,11 +273,11 @@ var Template = Module("Template", {
case "boolean":
return {str};
case "function":
- // Vim generally doesn't like /foo*/, because */ looks like a comment terminator.
- // Using /foo*(:?)/ instead.
+ str = str.replace("/* use strict */ \n", "/* use strict */ ");
if (processStrings)
return {str.replace(/\{(.|\n)*(?:)/g, "{ ... }")};
<>}>; /* Vim */
+ arg = String(arg).replace("/* use strict */ \n", "/* use strict */ ");
return <>{arg}>;
case "undefined":
return {arg};
@@ -302,7 +302,10 @@ var Template = Module("Template", {
}
},
- highlightFilter: function highlightFilter(str, filter, highlight) {
+ highlightFilter: function highlightFilter(str, filter, highlight, isURI) {
+ if (isURI)
+ str = util.losslessDecodeURI(str);
+
return this.highlightSubstrings(str, (function () {
if (filter.length == 0)
return;
diff --git a/common/modules/util.jsm b/common/modules/util.jsm
index eb32b870..44687d59 100644
--- a/common/modules/util.jsm
+++ b/common/modules/util.jsm
@@ -1094,7 +1094,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
catch (e) {
return url;
}
- }, this).join("%25");
+ }, this).join("%25").replace(/[\s.,>)]$/, encodeURIComponent);
},
/**