tmpvar / repl.history

persist a node repl's history
MIT License
55 stars 19 forks source link

Lines doubled in .node_history #1

Closed scttnlsn closed 12 years ago

scttnlsn commented 12 years ago

After entering the following lines in the repl:

var x = 123;
console.log(x);

My .node_history looked like this:

var x = 123;
ar x = 123
console.log(x);
onsole.log(x)

I believe eval gets called twice in order to determine whether the command should span multiple lines. Rather than overriding eval I tried just listening for the line event emitted by readline. Seems to work for me.

tmpvar commented 12 years ago

landed, thanks!