gitlab.com/apertussolutions/u-root@v7.0.0+incompatible/cmds/core/elvish/edit/max_height.go (about)

     1  package edit
     2  
     3  import (
     4  	"math"
     5  
     6  	"github.com/u-root/u-root/cmds/core/elvish/eval"
     7  	"github.com/u-root/u-root/cmds/core/elvish/eval/vars"
     8  	"github.com/u-root/u-root/cmds/core/elvish/util"
     9  )
    10  
    11  func init() {
    12  	atEditorInit(func(ed *editor, ns eval.Ns) {
    13  		ed.maxHeight = math.Inf(1)
    14  		ns["max-height"] = vars.FromPtr(&ed.maxHeight)
    15  	})
    16  }
    17  
    18  func maxHeightToInt(h float64) int {
    19  	if math.IsInf(h, 1) {
    20  		return util.MaxInt
    21  	}
    22  	return int(h)
    23  }