Revert incomplete "Allow hiding of TypedCommand cmd and output"
This commit is contained in:
parent
48680338bf
commit
0d797ea684
|
@ -126,30 +126,23 @@ case class Pause(millisec: Long) extends Slide
|
|||
case object PauseKey extends Slide
|
||||
case class Meta(contents: (Presentation, Int) => Slide) extends Slide
|
||||
|
||||
case class TypedCommand[T](exec: T => String, display: String, cmd: T, cmdIsHidden: Boolean, outputIsHidden: Boolean) extends Slide:
|
||||
case class TypedCommand[T](exec: T => String, display: String, cmd: T) extends Slide:
|
||||
private lazy val _output = exec(cmd)
|
||||
def output = _output
|
||||
|
||||
infix def showing (s: String): TypedCommand[T] = TypedCommand(exec, s, cmd)
|
||||
|
||||
def show() =
|
||||
force()
|
||||
if ! cmdIsHidden then
|
||||
prompt()
|
||||
Terminal.showCursor()
|
||||
typeCmd()
|
||||
if ! outputIsHidden then
|
||||
print(output)
|
||||
if ! cmdIsHidden then
|
||||
Terminal.hideCursor()
|
||||
prompt()
|
||||
Terminal.showCursor()
|
||||
typeCmd()
|
||||
print(output)
|
||||
Terminal.hideCursor()
|
||||
|
||||
def quickShow() =
|
||||
force()
|
||||
if ! cmdIsHidden then
|
||||
prompt()
|
||||
println(display)
|
||||
if ! outputIsHidden then
|
||||
print(output)
|
||||
prompt()
|
||||
println(display)
|
||||
print(output)
|
||||
|
||||
def prompt() = print(fansi.Color.LightGreen("user@host % "))
|
||||
def force() = _output
|
||||
|
|
Loading…
Reference in a new issue