commit

package
v0.0.0-...-edbbb69 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenCommitEditorCmd

func OpenCommitEditorCmd(opts git.CommitOpts, action string) tea.Cmd

OpenCommitEditorCmd returns a command to open the commit editor.

Types

type CommitEditorAbortMsg

type CommitEditorAbortMsg struct{}

CommitEditorAbortMsg signals user aborted.

type CommitEditorDoneMsg

type CommitEditorDoneMsg struct {
	Hash string
	Err  error
}

CommitEditorDoneMsg signals commit completed.

type KeyMap

type KeyMap struct {
	Close           key.Binding // q
	Submit          key.Binding // <c-c><c-c> (two-key sequence handled in update)
	Abort           key.Binding // <c-c><c-k> (two-key sequence handled in update)
	PrevMessage     key.Binding // <m-p>
	NextMessage     key.Binding // <m-n>
	ResetMessage    key.Binding // <m-r>
	GenerateMessage key.Binding // <c-g>
}

KeyMap defines all key bindings for the commit editor. Matches Neogit's config.lua commit_editor section exactly.

func DefaultKeyMap

func DefaultKeyMap() KeyMap

DefaultKeyMap returns the default key bindings matching Neogit exactly.

type Model

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

Model is the commit editor model.

func New

func New(repo *git.Repository, opts git.CommitOpts, cfg *config.Config, tokens theme.Tokens, action string) Model

New creates a new commit editor model.

func (Model) Aborted

func (m Model) Aborted() bool

Aborted returns whether the editor was aborted.

func (Model) Done

func (m Model) Done() bool

Done returns whether the editor is done.

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model and starts loading data.

func (*Model) SetSize

func (m *Model) SetSize(width, height int)

SetSize sets the editor dimensions.

func (Model) Update

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

Update handles messages.

func (Model) View

func (m Model) View() string

View renders the editor.

type OpenCommitEditorMsg

type OpenCommitEditorMsg struct {
	Opts   git.CommitOpts
	Action string // "commit", "amend", "reword", "extend", etc.
}

OpenCommitEditorMsg triggers opening the commit editor.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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