common

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPalette = NewPalette()

Functions

func CircularSearch added in v0.10.0

func CircularSearch(items []screen.Searchable, query string, startIndex, cursor int, backward bool) int

CircularSearch performs a circular search through searchable items. Returns the index of the first matching item, or cursor if no match is found.

func Close

func Close() tea.Msg

func CloseApplied added in v0.9.9

func CloseApplied() tea.Msg

func Debounce added in v0.9.7

func Debounce(identifier string, duration time.Duration, cmd tea.Cmd) tea.Cmd

Debounce waits for the given duration before running cmd; newer calls with the same identifier cancel previous ones.

func FileSearch added in v0.9.1

func FileSearch(revset string, preview bool, commit *jj.Commit, rawFileOut []byte) tea.Cmd

func IsInputMessage added in v0.9.10

func IsInputMessage(msg tea.Msg) bool

func Refresh

func Refresh() tea.Msg

func RefreshAndKeepSelections added in v0.8.12

func RefreshAndKeepSelections() tea.Msg

func RefreshAndSelect

func RefreshAndSelect(selectedRevision string) tea.Cmd

func RestoreOperation added in v0.9.9

func RestoreOperation(op any) tea.Cmd

func SelectionChanged

func SelectionChanged(item SelectedItem) tea.Cmd

func StartAceJump added in v0.9.9

func StartAceJump() tea.Cmd

func UpdateRevSet added in v0.9.0

func UpdateRevSet(revset string) tea.Cmd

Types

type AutoRefreshMsg added in v0.8.12

type AutoRefreshMsg struct{}

type CloseViewMsg

type CloseViewMsg struct {
	Applied bool
}

type CommandCompletedMsg

type CommandCompletedMsg struct {
	ID     int
	Output string
	Err    error
}

type CommandRunningMsg

type CommandRunningMsg struct {
	ID      int
	Command string
}

type DispatchActionMsg added in v0.10.0

type DispatchActionMsg struct {
	Action  string
	Args    map[string]any
	BuiltIn bool
}

type Editable added in v0.9.4

type Editable interface {
	IsEditing() bool
}

type ExecMode added in v0.9.0

type ExecMode struct {
	Mode   string
	Prompt string
}
var ExecJJ ExecMode = ExecMode{
	Mode:   "jj",
	Prompt: ": ",
}
var ExecShell ExecMode = ExecMode{
	Mode:   "sh",
	Prompt: "$ ",
}

type ExecMsg added in v0.9.0

type ExecMsg struct {
	Line string
	Mode ExecMode
}

type ExecProcessCompletedMsg added in v0.9.7

type ExecProcessCompletedMsg struct {
	Err error
	Msg ExecMsg
}

type FileSearchMsg added in v0.9.1

type FileSearchMsg struct {
	Revset       string
	PreviewShown bool
	Commit       *jj.Commit
	RawFileOut   []byte // raw output from `jj file list`
}

type Focusable

type Focusable interface {
	IsFocused() bool
}

type ImmediateModel added in v0.9.11

type ImmediateModel interface {
	Init() tea.Cmd
	Update(msg tea.Msg) tea.Cmd
	ViewRect(dl *render.DisplayContext, box layout.Box)
}

type Overlay added in v0.9.4

type Overlay interface {
	IsOverlay() bool
}

type Palette

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

func NewPalette added in v0.9.0

func NewPalette() *Palette

func (*Palette) Get added in v0.9.0

func (p *Palette) Get(selector string) lipgloss.Style

func (*Palette) GetBorder added in v0.9.0

func (p *Palette) GetBorder(selector string, border lipgloss.Border) lipgloss.Style

func (*Palette) Update added in v0.8.12

func (p *Palette) Update(styleMap map[string]config.Color)

type QuickSearchMsg added in v0.8.3

type QuickSearchMsg string

type RefreshMsg

type RefreshMsg struct {
	SelectedRevision string
	KeepSelections   bool
}

type RestoreOperationMsg added in v0.9.9

type RestoreOperationMsg struct {
	Operation any
}

type RunLuaScriptMsg added in v0.9.8

type RunLuaScriptMsg struct {
	Script string
}

type SelectedCommit added in v0.9.10

type SelectedCommit struct {
	CommitId string
}

func (SelectedCommit) Equal added in v0.9.10

func (s SelectedCommit) Equal(other SelectedItem) bool

type SelectedFile added in v0.9.10

type SelectedFile struct {
	ChangeId string
	CommitId string
	File     string
}

func (SelectedFile) Equal added in v0.9.10

func (s SelectedFile) Equal(other SelectedItem) bool

type SelectedItem added in v0.9.10

type SelectedItem interface {
	Equal(other SelectedItem) bool
}

type SelectedOperation added in v0.9.10

type SelectedOperation struct {
	OperationId string
}

func (SelectedOperation) Equal added in v0.9.10

func (s SelectedOperation) Equal(other SelectedItem) bool

type SelectedRevision added in v0.9.10

type SelectedRevision struct {
	ChangeId string
	CommitId string
}

func (SelectedRevision) Equal added in v0.9.10

func (s SelectedRevision) Equal(other SelectedItem) bool

type SelectionChangedMsg

type SelectionChangedMsg struct {
	Item SelectedItem
}

type ShowChooseMsg added in v0.9.9

type ShowChooseMsg struct {
	Options []string
	Title   string
	Filter  bool
	Ordered bool
}

type ShowInputMsg added in v0.9.9

type ShowInputMsg struct {
	Title  string
	Prompt string
}

type ShowPreview added in v0.9.1

type ShowPreview bool

type StackedModel added in v0.10.0

type StackedModel interface {
	ImmediateModel
	StackedActionOwner() string
}

StackedModel is the contract for models presented in the stacked overlay. It includes the action owner so UI scope resolution can dispatch correctly.

type StartAceJumpMsg added in v0.9.9

type StartAceJumpMsg struct{}

type State

type State int
const (
	Loading State = iota
	Ready
)

type TogglePasswordMsg added in v0.9.9

type TogglePasswordMsg struct {
	Prompt   string
	Password chan []byte
}

type UpdateBookmarksMsg

type UpdateBookmarksMsg struct {
	Bookmarks []string
	Revision  string
}

type UpdateRevSetMsg added in v0.9.0

type UpdateRevSetMsg string

type UpdateRevisionsFailedMsg

type UpdateRevisionsFailedMsg struct {
	Output string
	Err    error
}

type UpdateRevisionsSuccessMsg added in v0.8.12

type UpdateRevisionsSuccessMsg struct{}

type ViewRange added in v0.9.4

type ViewRange struct {
	Width         int
	Height        int
	Start         int
	FirstRowIndex int
	LastRowIndex  int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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