From d1ecfe8041c5470a052ab10ca7f9c8bf101f07ff Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sat, 25 Sep 2010 02:15:45 -0400 Subject: [PATCH] Fix :finish. --- common/content/io.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/content/io.js b/common/content/io.js index fd45ac6c..2a885a20 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -379,6 +379,8 @@ lookup: let iter = Iterator(lines); for (let [i, line] in iter) { + if (this.sourcing.finished) + break; this.sourcing.line = i + 1; // skip line comments and blank lines line = line.replace(/\r$/, ""); @@ -535,7 +537,10 @@ lookup: // NOTE: this command is only used in :source commands.add(["fini[sh]"], "Stop sourcing a script file", - function () { dactyl.echoerr("E168: :finish used outside of a sourced file"); }, + function () { + dactyl.assert(io.sourcing, "E168: :finish used outside of a sourced file"); + io.sourcing.finished = true; + }, { argCount: "0" }); commands.add(["pw[d]"],