info

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EditInfoCmd

func EditInfoCmd() tea.Cmd

func HideInfoCmd

func HideInfoCmd() tea.Cmd

func ShowInfoCmd

func ShowInfoCmd() tea.Cmd

func ToggleVisibleCmd

func ToggleVisibleCmd() tea.Cmd

func UpdateContentCmd

func UpdateContentCmd(content string) tea.Cmd

Types

type EditInfoMsg

type EditInfoMsg struct {
}

type HideInfoMsg

type HideInfoMsg struct{}

type Info

type Info struct {
	Model viewport.Model

	Visible  bool
	Editable bool

	Sections []*Section

	Style  Style
	Toggle *key.Key
	// contains filtered or unexported fields
}

func New

func New() *Info

func (*Info) AddSections

func (i *Info) AddSections(sections ...*Section) *Info

func (*Info) Hide

func (i *Info) Hide()

func (*Info) HideKeys

func (i *Info) HideKeys() *Info

func (*Info) Init

func (m *Info) Init() tea.Cmd

func (*Info) NewSection

func (i *Info) NewSection() *Section

func (*Info) Render

func (i *Info) Render() string

func (*Info) SetContent

func (i *Info) SetContent(c string) *Info

func (*Info) SetHeight

func (i *Info) SetHeight(h int) *Info

func (*Info) SetSections

func (i *Info) SetSections(sections ...*Section) *Info

func (*Info) SetSize

func (i *Info) SetSize(w, h int) *Info

func (*Info) SetTitle

func (i *Info) SetTitle(title string) *Info

func (*Info) SetToggle

func (m *Info) SetToggle(toggle, help string) *Info

func (*Info) Show

func (i *Info) Show()

func (Info) Title

func (i Info) Title() string

func (*Info) ToggleVisible

func (i *Info) ToggleVisible()

func (*Info) Update

func (m *Info) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (m *Info) Update(msg tea.Msg) (*Info, tea.Cmd) {

func (*Info) View

func (m *Info) View() string

type Section

type Section struct {
	// contains filtered or unexported fields
}

func NewSection

func NewSection() *Section

func (Section) Render

func (s Section) Render(style Style, hideKeys bool) string

func (*Section) SetFields

func (s *Section) SetFields(fields data.Fields) *Section

func (*Section) SetTitle

func (s *Section) SetTitle(title string) *Section

type ShowInfoMsg

type ShowInfoMsg struct{}

type Style

type Style struct {
	style.Field
	style.Frame
	Title lipgloss.Style
}

func DefaultStyles

func DefaultStyles() Style

type ToggleVisibleMsg

type ToggleVisibleMsg struct{}

info commands

type UpdateContentMsg

type UpdateContentMsg struct {
	Content string
}

Jump to

Keyboard shortcuts

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