src.elv.sh@v0.21.0-dev.0.20240515223629-06979efb9a2a/pkg/cli/tk/empty.go (about)

     1  package tk
     2  
     3  import (
     4  	"src.elv.sh/pkg/cli/term"
     5  )
     6  
     7  // Empty is an empty widget.
     8  type Empty struct{}
     9  
    10  // Render shows nothing, although the resulting Buffer still occupies one line.
    11  func (Empty) Render(width, height int) *term.Buffer {
    12  	return term.NewBufferBuilder(width).Buffer()
    13  }
    14  
    15  // MaxHeight returns 1, since this widget always occupies one line.
    16  func (Empty) MaxHeight(width, height int) int {
    17  	return 1
    18  }
    19  
    20  // Handle always returns false.
    21  func (Empty) Handle(event term.Event) bool {
    22  	return false
    23  }