From c16f80c023259c80f72d4b61fdac0132b55ebbe9 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Wed, 8 Oct 2008 19:36:32 +0000 Subject: [PATCH] Fix heredocs from :so --- content/io.js | 7 ++++--- content/util.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/content/io.js b/content/io.js index a8813bff..2df54cb3 100644 --- a/content/io.js +++ b/content/io.js @@ -793,7 +793,7 @@ lookup: { if (heredocEnd.test(line)) { - liberator.eval(heredoc); + command.execute(args + "\n" + heredoc, special, count); heredoc = ""; heredocEnd = null; } @@ -808,8 +808,8 @@ lookup: if (/^\s*(".*)?$/.test(line)) continue; - let [count, cmd, special, args] = liberator.commands.parseCommand(line); - let command = liberator.commands.get(cmd); + var [count, cmd, special, args] = liberator.commands.parseCommand(line); + var command = liberator.commands.get(cmd); if (!command) { @@ -837,6 +837,7 @@ lookup: if (matches) { + args = matches[1]; heredocEnd = new RegExp("^" + matches[2] + "$", "m"); if (matches[1]) heredoc = matches[1] + "\n"; diff --git a/content/util.js b/content/util.js index 900638c8..7485953b 100644 --- a/content/util.js +++ b/content/util.js @@ -59,7 +59,7 @@ liberator.util = { //{{{ timer.cancel(); let timeout = minInterval; - if (now > this.doneAt) + if (now > this.doneAt && this.doneAt > -1) timeout = 0; else if (this.latest) timeout = Math.min(minInterval, this.latest - now);