1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 08:07:59 +01:00

Fix definition link for commands defined on the command-line.

This commit is contained in:
Kris Maglione
2010-12-18 18:56:17 -05:00
parent 08058d0e4d
commit 394420a9d1
8 changed files with 70 additions and 35 deletions

View File

@@ -560,7 +560,7 @@ const Commands = Module("commands", {
*/
execute: function (string, tokens, silent, args, sourcing) {
io.withSavedValues(["readHeredoc", "sourcing"], function () {
sourcing = sourcing || { file: "[Command Line]", line: 1 };
sourcing = sourcing || this.sourcing || { file: "[Command Line]", line: 1 };
this.sourcing = update({}, sourcing);
args = update({}, args || {});
@@ -648,7 +648,8 @@ const Commands = Module("commands", {
if (io.sourcing)
return {
__proto__: frame,
filename: services.io.newFileURI(File(io.sourcing.file)).spec,
filename: io.sourcing.file[0] == "[" ? io.sourcing.file :
services.io.newFileURI(File(io.sourcing.file)).spec,
lineNumber: io.sourcing.line
};
return frame;