mirror of
https://github.com/walles/moar.git
synced 2024-11-22 21:50:43 +03:00
21afb4f2ef
They are only needed at startup, so let's not keep them around while paging.
23 lines
317 B
Go
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()
|
|
}
|