1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-25 14:25:45 +01:00

Fix some unnecessary error reports for invalid jar: URLs. Also complete the JAR file portion of the URL.

This commit is contained in:
Kris Maglione
2011-03-10 10:58:02 -05:00
parent d7b68c66af
commit b7a3f8d2fb
3 changed files with 15 additions and 4 deletions

View File

@@ -340,7 +340,7 @@ var CompletionContext = Class("CompletionContext", {
get itemPrototype() {
let res = {};
function result(quote) {
yield ["result", quote ? function () quote[0] + quote[1](this.text) + quote[2]
yield ["result", quote ? function () quote[0] + util.trapErrors(1, quote, this.text) + quote[2]
: function () this.text];
};
for (let i in iter(this.keys, result(this.quote))) {
@@ -903,6 +903,13 @@ var Completion = Module("completion", {
// depending on the 'complete' option
// if the 'complete' argument is passed like "h", it temporarily overrides the complete option
url: function url(context, complete) {
if (/^jar:[^!]*$/.test(context.filter)) {
context.advance(4);
context.quote = context.quote || ["", util.identity, ""];
let quote = context.quote[1];
context.quote[1] = function (str) quote(str.replace(/!/g, escape));
}
if (this.options["urlseparator"])
var skip = util.regexp("^.*" + this.options["urlseparator"] + "\\s*")