~kb/terminimal

79f6b1ec1ef32eccc034cd75fc6b5afd5da9d1ef — Kim Burgess 5 years ago fdfe946
support static spinner messages
1 files changed, 11 insertions(+), 1 deletions(-)

M src/terminimal.cr
M src/terminimal.cr => src/terminimal.cr +11 -1
@@ 36,7 36,17 @@ module Terminimal
  # ditto
  def spinner(await : Concurrent::Future, style = Spinner::Style::UNI_DOTS, async = false, &message : Proc(String))
    future_completed = ->{ await.completed? || await.canceled? }
    spinner future_completed, style, async, &message
    spinner(future_completed, style, async, &message)
  end

  # ditto
  def spinner(await : Proc(Bool), style = Spinner::Style::UNI_DOTS, async = false, message = "")
    spinner(await, style, async) { message }
  end

  # ditto
  def spinner(await : Concurrent::Future, style = Spinner::Style::UNI_DOTS, async = false, message = "")
    spinner(await, style, async) { message }
  end

  # Possible direction from screen and line clearing (relative to cursor pos).