viewport

package
v3.71.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Viewport

type Viewport struct {
	*viewport.Model
	// contains filtered or unexported fields
}

Viewport represents a viewport component.

func New

func New(c common.Common) *Viewport

New returns a new Viewport.

func (*Viewport) GotoBottom

func (v *Viewport) GotoBottom()

GotoBottom moves the viewport to the bottom of the log.

func (*Viewport) GotoTop

func (v *Viewport) GotoTop()

GotoTop moves the viewport to the top of the log.

func (*Viewport) HalfViewDown

func (v *Viewport) HalfViewDown()

HalfViewDown moves the viewport down by half the viewport height.

func (*Viewport) HalfViewUp

func (v *Viewport) HalfViewUp()

HalfViewUp moves the viewport up by half the viewport height.

func (*Viewport) Init

func (v *Viewport) Init() tea.Cmd

Init implements tea.Model.

func (*Viewport) LineDown

func (v *Viewport) LineDown(n int) []string

LineDown moves the viewport down by the given number of lines.

func (*Viewport) LineUp

func (v *Viewport) LineUp(n int) []string

LineUp moves the viewport up by the given number of lines.

func (*Viewport) ScrollPercent

func (v *Viewport) ScrollPercent() float64

ScrollPercent returns the viewport's scroll percentage.

func (*Viewport) SetContent

func (v *Viewport) SetContent(content string)

SetContent sets the viewport's content.

func (*Viewport) SetSize

func (v *Viewport) SetSize(width, height int)

SetSize implements common.Component.

func (*Viewport) Update

func (v *Viewport) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*Viewport) View

func (v *Viewport) View() string

View implements tea.Model.

func (*Viewport) ViewDown

func (v *Viewport) ViewDown() []string

ViewDown moves the viewport down by a page.

func (*Viewport) ViewUp

func (v *Viewport) ViewUp() []string

ViewUp moves the viewport up by a page.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL