Skip to content

Commit

Permalink
Fixed #18: BUG: newlines not printed to stdout, produces different ou…
Browse files Browse the repository at this point in the history
…tput from nim
  • Loading branch information
AndreiRegiani committed Jul 12, 2018
1 parent f7df997 commit c32bd4f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/inim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,13 @@ proc runForever() =
let lines = output.splitLines
# Print only output you haven't seen
stdout.setForegroundColor(fgCyan, true)
for line in lines[currentOutputLine..^1]:
if line.strip != "":
echo line

let new_lines = lines[currentOutputLine..^1]
for index, line in new_lines:
if index+1 == len(new_lines) and line == "":
continue
echo line

currentOutputLine = len(lines)-1
stdout.resetAttributes()
stdout.flushFile()
Expand Down

0 comments on commit c32bd4f

Please sign in to comment.