Browse Source

micro-refactor, use rli.output.write instead of rli.write ('line' event was emitted for those writes)

Fedor Indutny 14 years ago
committed by Ryan Dahl
parent
commit
41a41825f6
  1. 14
      lib/repl.js

14
lib/repl.js

@ -124,17 +124,19 @@ function REPLServer(prompt, stream, eval) {
rli.close();
process.exit();
}
var bareInt = false;
rli.line = '';
if (!(self.bufferedCommand && self.bufferedCommand.length > 0) &&
rli.line.length === 0) {
rli.write('\n(^C again to quit)');
bareInt = true;
rli.output.write('\n(^C again to quit)\n');
sawSIGINT = true;
} else {
rli.output.write('\n');
}
rli.line = '';
rli.write('\n');
self.bufferedCommand = '';
self.displayPrompt();
sawSIGINT = bareInt;
});
rli.addListener('line', function(cmd) {

Loading…
Cancel
Save