Skip to content

Commit

Permalink
Merge pull request #3498 from zetashift/console-add-flush-call
Browse files Browse the repository at this point in the history
Add flush to print functions in std.Console
  • Loading branch information
djspiewak authored Mar 22, 2023
2 parents b3b24ea + 54f1cf2 commit b959325
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,18 @@ private[std] abstract class ConsoleCompanionCrossPlatform {

def print[A](a: A)(implicit S: Show[A] = Show.fromToString[A]): F[Unit] = {
val text = a.show
F.blocking(System.out.print(text))
F.blocking {
System.out.print(text)
System.out.flush()
}
}

def println[A](a: A)(implicit S: Show[A] = Show.fromToString[A]): F[Unit] = {
val text = a.show
F.blocking(System.out.println(text))
F.blocking {
System.out.println(text)
System.out.flush()
}
}

def error[A](a: A)(implicit S: Show[A] = Show.fromToString[A]): F[Unit] = {
Expand Down

0 comments on commit b959325

Please sign in to comment.