MCPcopy
hub / github.com/esm-dev/esm.sh / clearLines

Method clearLines

cli/command_add.go:447–458  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

445}
446
447func (ui *subModuleSelectUI) clearLines() {
448 func() {
449 height := ui.maxLines() + 1
450 term.MoveCursorUp(height)
451 for range height {
452 term.ClearLine()
453 os.Stdout.Write(EOL) // move to the next line
454 }
455 term.ClearLine()
456 term.MoveCursorUp(height)
457 }()
458}
459
460func (ui *subModuleSelectUI) maxLines() int {
461 return min(ui.termHeight-3, len(ui.subModules))

Callers 1

showMethod · 0.95

Calls 2

maxLinesMethod · 0.95
WriteMethod · 0.80

Tested by

no test coverage detected