From 8b8f522621d20ed43583d28f28f394dac0011ea6 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 18 Feb 2016 20:15:19 -0800 Subject: cmd: fix UI with lots of peers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `linesRemaining` wasn’t being decremented each time line() was called. --- bin/cmd.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index 29ceb35..94817fd 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -558,17 +558,17 @@ function drawTorrent (torrent) { return linesRemaining > 4 }) + line('{60:}') if (torrent.numPeers > peerslisted) { - line('{60:}') line('... and %s more', torrent.numPeers - peerslisted) } - line('{60:}') clivas.flush(true) - } - function line () { - clivas.line.apply(clivas, arguments) + function line () { + clivas.line.apply(clivas, arguments) + linesRemaining -= 1 + } } } -- cgit v1.2.3