mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Move lastLine setter into conditional block to prevent .commands and blank lines from setting lastLine
This commit is contained in:
@@ -115,8 +115,8 @@
|
||||
repl.rli.addListener('line', function(code) {
|
||||
if (code && code.length && code !== '.history' && lastLine !== code) {
|
||||
fs.write(fd, "" + code + "\n");
|
||||
return lastLine = code;
|
||||
}
|
||||
return lastLine = code;
|
||||
});
|
||||
process.on('exit', function() {
|
||||
return fs.closeSync(fd);
|
||||
|
||||
@@ -106,7 +106,7 @@ addHistory = (repl, filename, maxSize) ->
|
||||
if code and code.length and code isnt '.history' and lastLine isnt code
|
||||
# Save the latest command in the file
|
||||
fs.write fd, "#{code}\n"
|
||||
lastLine = code
|
||||
lastLine = code
|
||||
|
||||
process.on 'exit', ->
|
||||
fs.closeSync fd
|
||||
|
||||
Reference in New Issue
Block a user