common

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 7 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 {
	Styles *styles.Styles
	KeyMap *keymap.KeyMap
	Width  int
	Height int
}

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