Documentation
¶
Index ¶
- type ClearDiffTimerMsg
- type Config
- type ContentRenderedMsg
- type KeyBinds
- type PagerModel
- func (m *PagerModel) ExitSearch()
- func (m PagerModel) Render(yaml string) tea.Cmd
- func (m *PagerModel) SetSize(w, h int)
- func (m *PagerModel) StartClearDiffTimer() tea.Cmd
- func (m *PagerModel) Unload()
- func (m PagerModel) Update(msg tea.Msg) (PagerModel, tea.Cmd)
- func (m PagerModel) View() string
- func (m *PagerModel) WaitForClearDiffTimer() tea.Cmd
- type ViewState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClearDiffTimerMsg ¶ added in v0.20.0
type ClearDiffTimerMsg struct{}
type Config ¶
type Config struct {
CommonModel *common.CommonModel
KeyBinds *KeyBinds
ChromaRendering bool
ShowLineNumbers bool
}
type ContentRenderedMsg ¶
type ContentRenderedMsg string
type KeyBinds ¶
type KeyBinds struct {
Copy *keys.KeyBind `json:"copy,omitempty"`
// Navigation.
Home *keys.KeyBind `json:"home,omitempty"`
End *keys.KeyBind `json:"end,omitempty"`
PageUp *keys.KeyBind `json:"pageUp,omitempty"`
PageDown *keys.KeyBind `json:"pageDown,omitempty"`
HalfPageUp *keys.KeyBind `json:"halfPageUp,omitempty"`
HalfPageDown *keys.KeyBind `json:"halfPageDown,omitempty"`
// Search.
Search *keys.KeyBind `json:"search,omitempty"`
NextMatch *keys.KeyBind `json:"nextMatch,omitempty"`
PrevMatch *keys.KeyBind `json:"prevMatch,omitempty"`
}
func (*KeyBinds) EnsureDefaults ¶
func (kb *KeyBinds) EnsureDefaults()
func (*KeyBinds) GetKeyBinds ¶
type PagerModel ¶
type PagerModel struct {
// Current document being rendered, sans-chroma rendering. We cache
// it here so we can re-render it on resize.
CurrentDocument yamls.Document
ViewState ViewState
ShowHelp bool
// contains filtered or unexported fields
}
func NewModel ¶
func NewModel(c Config) PagerModel
func (PagerModel) Render ¶
func (m PagerModel) Render(yaml string) tea.Cmd
This is where the magic happens.
func (*PagerModel) SetSize ¶
func (m *PagerModel) SetSize(w, h int)
func (*PagerModel) StartClearDiffTimer ¶ added in v0.20.0
func (m *PagerModel) StartClearDiffTimer() tea.Cmd
StartClearDiffTimer starts a [diffTimeoutSeconds] timer to clear diff highlights.
func (*PagerModel) Unload ¶
func (m *PagerModel) Unload()
func (PagerModel) Update ¶
func (m PagerModel) Update(msg tea.Msg) (PagerModel, tea.Cmd)
func (PagerModel) View ¶
func (m PagerModel) View() string
func (*PagerModel) WaitForClearDiffTimer ¶ added in v0.20.0
func (m *PagerModel) WaitForClearDiffTimer() tea.Cmd
WaitForClearDiffTimer returns a command that waits for the clear diff timer to expire.
Click to show internal directories.
Click to hide internal directories.