mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 00:28:00 +01:00
Fix :!foo completion (but not :! foo completion, which works fine).
This commit is contained in:
@@ -1001,7 +1001,7 @@ const Commands = Module("commands", {
|
|||||||
var context = complete.fork("args", len);
|
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 });
|
args = command.parseArgs(args, context, { count: count, bang: bang });
|
||||||
else
|
else
|
||||||
args = commands.parseArgs(args, { extra: { count: count, bang: bang } });
|
args = commands.parseArgs(args, { extra: { count: count, bang: bang } });
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ const File = Class("File", {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
util.reportError(e);
|
util.reportError(e);
|
||||||
return null;
|
return File.DoesNotExist(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let self = XPCSafeJSObjectWrapper(file);
|
let self = XPCSafeJSObjectWrapper(file);
|
||||||
@@ -489,6 +489,11 @@ const File = Class("File", {
|
|||||||
return this.PATH_SEP = f.path.substr(f.parent.path.length, 1);
|
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",
|
defaultEncoding: "UTF-8",
|
||||||
|
|
||||||
expandPath: function (path, relative) {
|
expandPath: function (path, relative) {
|
||||||
@@ -543,7 +548,7 @@ const File = Class("File", {
|
|||||||
path.appendRelativePath(this.expandPath(tail, true));
|
path.appendRelativePath(this.expandPath(tail, true));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return { exists: function () false, __noSuchMethod__: function () { throw e; } };
|
return File.DoesNotExist(e);
|
||||||
}
|
}
|
||||||
return path;
|
return path;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user