Help us shape the future of Go! Take the 2026 Go Developer Survey

viewport

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

forked from: https://github.com/charmbracelet/bubbles/blob/master/viewport/viewport.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ViewDown

func ViewDown(m Viewport, lines []string) tea.Cmd

func ViewUp

func ViewUp(m Viewport, lines []string) tea.Cmd

Types

type Viewport

type Viewport struct {
	Width  int
	Height int
	KeyMap keymap.KeyMap

	MouseWheelEnabled bool

	MouseWheelDelta int

	YOffset int

	YPosition int

	Style lipgloss.Style
	// contains filtered or unexported fields
}

func NewViewport

func NewViewport(width, height int) (m Viewport)

func (Viewport) AtBottom

func (m Viewport) AtBottom() bool

func (Viewport) AtTop

func (m Viewport) AtTop() bool

func (*Viewport) GotoBottom

func (m *Viewport) GotoBottom() (lines []string)

func (*Viewport) GotoTop

func (m *Viewport) GotoTop() (lines []string)

func (*Viewport) HalfViewDown

func (m *Viewport) HalfViewDown() (lines []string)

func (*Viewport) HalfViewUp

func (m *Viewport) HalfViewUp() (lines []string)

func (Viewport) Init

func (m Viewport) Init() tea.Cmd

func (*Viewport) LineDown

func (m *Viewport) LineDown(n int) (lines []string)

func (*Viewport) LineUp

func (m *Viewport) LineUp(n int) (lines []string)

func (Viewport) PastBottom

func (m Viewport) PastBottom() bool

func (Viewport) ScrollPercent

func (m Viewport) ScrollPercent() float64

func (*Viewport) SetContent

func (m *Viewport) SetContent(s string)

func (*Viewport) SetYOffset

func (m *Viewport) SetYOffset(n int)

func (Viewport) Update

func (m Viewport) Update(msg tea.Msg) (Viewport, tea.Cmd)

func (Viewport) View

func (m Viewport) View() string

func (*Viewport) ViewDown

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

func (*Viewport) ViewUp

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

Jump to

Keyboard shortcuts

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