common

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorCmd

func ErrorCmd(err error) tea.Cmd

ErrorCmd returns an ErrorMsg from error.

func StyleConfig

func StyleConfig() gansi.StyleConfig

StyleConfig returns the default Glamour style configuration.

func TruncateString

func TruncateString(s string, max int) string

TruncateString is a convenient wrapper around truncate.TruncateString.

Types

type Common

type Common struct {
	Copy   *osc52.Output
	Styles *styles.Styles
	KeyMap *keymap.KeyMap
	Width  int
	Height int
	Zone   *zone.Manager
}

Common is a struct all components should embed.

func (*Common) SetSize

func (c *Common) SetSize(width, height int)

SetSize sets the width and height of the common struct.

type Component

type Component interface {
	tea.Model
	help.KeyMap
	SetSize(width, height int)
}

Component represents a Bubble Tea model that implements a SetSize function.

type ErrorMsg

type ErrorMsg error

ErrorMsg is a Bubble Tea message that represents an error.

Jump to

Keyboard shortcuts

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