1
1
mirror of https://github.com/walles/moar.git synced 2024-11-22 21:50:43 +03:00
moar/m/embed-api.go
Johan Walles 21afb4f2ef Don't track the formatter
They are only needed at startup, so let's not keep them around while
paging.
2023-12-17 16:09:29 +01:00

23 lines
317 B
Go

package m
import (
"github.com/walles/moar/twin"
)
// Page displays text in a pager.
func (p *Pager) Page() error {
screen, e := twin.NewScreen()
if e != nil {
// Screen setup failed
return e
}
p.StartPaging(screen, nil, nil)
screen.Close()
if p.DeInit {
return nil
}
return p.ReprintAfterExit()
}