1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 00:37:58 +01:00

Fix :!foo completion (but not :! foo completion, which works fine).

This commit is contained in:
Kris Maglione
2010-10-18 23:33:42 -04:00
parent b34fe0b741
commit 4ce5925ace
2 changed files with 8 additions and 3 deletions

View File

@@ -1001,7 +1001,7 @@ const Commands = Module("commands", {
var context = complete.fork("args", len);
}
if (!complete || /\w[!\s]/.test(str))
if (!complete || /(\w|^)[!\s]/.test(str))
args = command.parseArgs(args, context, { count: count, bang: bang });
else
args = commands.parseArgs(args, { extra: { count: count, bang: bang } });

View File

@@ -282,7 +282,7 @@ const File = Class("File", {
}
catch (e) {
util.reportError(e);
return null;
return File.DoesNotExist(e);
}
}
let self = XPCSafeJSObjectWrapper(file);
@@ -489,6 +489,11 @@ const File = Class("File", {
return this.PATH_SEP = f.path.substr(f.parent.path.length, 1);
},
DoesNotExist: function (error) ({
exists: function () false,
__noSuchMethod__: function () { throw error || Error("Does not exist"); }
}),
defaultEncoding: "UTF-8",
expandPath: function (path, relative) {
@@ -543,7 +548,7 @@ const File = Class("File", {
path.appendRelativePath(this.expandPath(tail, true));
}
catch (e) {
return { exists: function () false, __noSuchMethod__: function () { throw e; } };
return File.DoesNotExist(e);
}
return path;
},