Documentation ¶
Index ¶
- Constants
- Variables
- func NewDisplayContext(key types.ContextKey, view *gocui.View, windowName string) types.Context
- func Zero[T any]() T
- type BaseContext
- func (self *BaseContext) AddKeybindingsFn(fn types.KeybindingsFn)
- func (self *BaseContext) AddMouseKeybindingsFn(fn types.MouseKeybindingsFn)
- func (self *BaseContext) AddOnClickFn(fn func() error)
- func (self *BaseContext) AddOnFocusFn(fn onFocusFn)
- func (self *BaseContext) AddOnFocusLostFn(fn onFocusLostFn)
- func (self *BaseContext) AddOnRenderToMainFn(fn func() error)
- func (self *BaseContext) GetKey() types.ContextKey
- func (self *BaseContext) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding
- func (self *BaseContext) GetKind() types.ContextKind
- func (self *BaseContext) GetMouseKeybindings(opts types.KeybindingsOpts) []*gocui.ViewMouseBinding
- func (self *BaseContext) GetOnClick() func() error
- func (self *BaseContext) GetOnFocus() onFocusFn
- func (self *BaseContext) GetOnFocusLost() onFocusLostFn
- func (self *BaseContext) GetOnRenderToMain() func() error
- func (self *BaseContext) GetOptionsMap() map[string]string
- func (self *BaseContext) GetView() *gocui.View
- func (self *BaseContext) GetViewName() string
- func (self *BaseContext) GetViewTrait() types.IViewTrait
- func (self *BaseContext) GetWindowName() string
- func (self *BaseContext) HasControlledBounds() bool
- func (self *BaseContext) IsFocusable() bool
- func (self *BaseContext) IsTransient() bool
- func (self *BaseContext) SetWindowName(windowName string)
- func (self *BaseContext) Title() string
- type BranchesContext
- type CommitFilesContext
- type CommitMessageContext
- func (self *CommitMessageContext) GetHistoryMessage() string
- func (self *CommitMessageContext) GetPreserveMessage() bool
- func (self *CommitMessageContext) GetPreservedMessage() string
- func (self *CommitMessageContext) GetSelectedIndex() int
- func (self *CommitMessageContext) OnConfirm(summary string, description string) error
- func (self *CommitMessageContext) RenderCommitLength()
- func (self *CommitMessageContext) SetHistoryMessage(message string)
- func (self *CommitMessageContext) SetPanelState(index int, summaryTitle string, descriptionTitle string, preserveMessage bool, ...)
- func (self *CommitMessageContext) SetPreservedMessage(message string)
- func (self *CommitMessageContext) SetSelectedIndex(value int)
- type CommitMessageViewModel
- type ConfirmationContext
- type ConfirmationContextState
- type ConflictsViewModel
- type ContextCommon
- type ContextTree
- type DynamicTitleBuilder
- type FilteredList
- func (self *FilteredList[T]) ClearFilter()
- func (self *FilteredList[T]) GetFilter() string
- func (self *FilteredList[T]) GetFilteredList() []T
- func (self *FilteredList[T]) IsFiltering() bool
- func (self *FilteredList[T]) SetFilter(filter string)
- func (self *FilteredList[T]) UnfilteredIndex(index int) int
- func (self *FilteredList[T]) UnfilteredLen() int
- type FilteredListViewModel
- type ListContextTrait
- func (self *ListContextTrait) FocusLine()
- func (self *ListContextTrait) GetList() types.IList
- func (self *ListContextTrait) HandleFocus(opts types.OnFocusOpts) error
- func (self *ListContextTrait) HandleFocusLost(opts types.OnFocusLostOpts) error
- func (self *ListContextTrait) HandleRender() error
- func (self *ListContextTrait) IsListContext()
- func (self *ListContextTrait) OnSearchSelect(selectedLineIdx int) error
- type ListViewModel
- type LocalCommitsContext
- type LocalCommitsViewModel
- func (self *LocalCommitsViewModel) GetCommits() []*models.Commit
- func (self *LocalCommitsViewModel) GetLimitCommits() bool
- func (self *LocalCommitsViewModel) GetShowWholeGitGraph() bool
- func (self *LocalCommitsViewModel) SetLimitCommits(value bool)
- func (self *LocalCommitsViewModel) SetShowWholeGitGraph(value bool)
- type MenuContext
- type MenuViewModel
- type MergeConflictsContext
- func (self *MergeConflictsContext) FocusSelection()
- func (self *MergeConflictsContext) GetContentToRender(isFocused bool) string
- func (self *MergeConflictsContext) GetMutex() *deadlock.Mutex
- func (self *MergeConflictsContext) GetOriginY() int
- func (self *MergeConflictsContext) GetState() *mergeconflicts.State
- func (self *MergeConflictsContext) IsUserScrolling() bool
- func (self *MergeConflictsContext) Render(isFocused bool) error
- func (self *MergeConflictsContext) RenderAndFocus(isFocused bool) error
- func (self *MergeConflictsContext) SetState(state *mergeconflicts.State)
- func (self *MergeConflictsContext) SetUserScrolling(isScrolling bool)
- type NewBaseContextOpts
- type ParentContextMgr
- type PatchExplorerContext
- func (self *PatchExplorerContext) Focus() error
- func (self *PatchExplorerContext) FocusSelection()
- func (self *PatchExplorerContext) GetContentToRender(isFocused bool) string
- func (self *PatchExplorerContext) GetIncludedLineIndices() []int
- func (self *PatchExplorerContext) GetMutex() *deadlock.Mutex
- func (self *PatchExplorerContext) GetState() *patch_exploring.State
- func (self *PatchExplorerContext) GetViewTrait() types.IViewTrait
- func (self *PatchExplorerContext) IsPatchExplorerContext()
- func (self *PatchExplorerContext) NavigateTo(isFocused bool, selectedLineIdx int) error
- func (self *PatchExplorerContext) Render(isFocused bool) error
- func (self *PatchExplorerContext) RenderAndFocus(isFocused bool) error
- func (self *PatchExplorerContext) SetState(state *patch_exploring.State)
- type ReflogCommitsContext
- func (self *ReflogCommitsContext) CanRebase() bool
- func (self *ReflogCommitsContext) GetCommits() []*models.Commit
- func (self *ReflogCommitsContext) GetDiffTerminals() []string
- func (self *ReflogCommitsContext) GetSelectedItemId() string
- func (self *ReflogCommitsContext) GetSelectedRef() types.Ref
- func (self *ReflogCommitsContext) ShowBranchHeadsInSubCommits() bool
- type RemoteBranchesContext
- type RemotesContext
- type SearchTrait
- type SimpleContext
- type StashContext
- type SubCommitsContext
- func (self *SubCommitsContext) CanRebase() bool
- func (self *SubCommitsContext) GetCommits() []*models.Commit
- func (self *SubCommitsContext) GetDiffTerminals() []string
- func (self *SubCommitsContext) GetLimitCommits() bool
- func (self *SubCommitsContext) GetSelectedItemId() string
- func (self *SubCommitsContext) GetSelectedRef() types.Ref
- func (self *SubCommitsContext) SetLimitCommits(value bool)
- func (self *SubCommitsContext) Title() string
- type SubCommitsViewModel
- type SubmodulesContext
- type SuggestionsContext
- type SuggestionsContextState
- type TabView
- type TagsContext
- type ViewTrait
- func (self *ViewTrait) FocusPoint(yIdx int)
- func (self *ViewTrait) PageDelta() int
- func (self *ViewTrait) ScrollDown(value int)
- func (self *ViewTrait) ScrollLeft()
- func (self *ViewTrait) ScrollRight()
- func (self *ViewTrait) ScrollUp(value int)
- func (self *ViewTrait) SelectedLineIdx() int
- func (self *ViewTrait) SetContent(content string)
- func (self *ViewTrait) SetFooter(value string)
- func (self *ViewTrait) SetHighlight(highlight bool)
- func (self *ViewTrait) SetOriginX(value int)
- func (self *ViewTrait) SetViewPortContent(content string)
- func (self *ViewTrait) ViewPortYBounds() (int, int)
- type WorkingTreeContext
- type WorktreesContext
Constants ¶
const ( // used as a nil value when passing a context key as an arg NO_CONTEXT types.ContextKey = "none" GLOBAL_CONTEXT_KEY types.ContextKey = "global" STATUS_CONTEXT_KEY types.ContextKey = "status" SNAKE_CONTEXT_KEY types.ContextKey = "snake" FILES_CONTEXT_KEY types.ContextKey = "files" LOCAL_BRANCHES_CONTEXT_KEY types.ContextKey = "localBranches" REMOTES_CONTEXT_KEY types.ContextKey = "remotes" WORKTREES_CONTEXT_KEY types.ContextKey = "worktrees" REMOTE_BRANCHES_CONTEXT_KEY types.ContextKey = "remoteBranches" TAGS_CONTEXT_KEY types.ContextKey = "tags" LOCAL_COMMITS_CONTEXT_KEY types.ContextKey = "commits" REFLOG_COMMITS_CONTEXT_KEY types.ContextKey = "reflogCommits" SUB_COMMITS_CONTEXT_KEY types.ContextKey = "subCommits" COMMIT_FILES_CONTEXT_KEY types.ContextKey = "commitFiles" STASH_CONTEXT_KEY types.ContextKey = "stash" NORMAL_MAIN_CONTEXT_KEY types.ContextKey = "normal" NORMAL_SECONDARY_CONTEXT_KEY types.ContextKey = "normalSecondary" STAGING_MAIN_CONTEXT_KEY types.ContextKey = "staging" STAGING_SECONDARY_CONTEXT_KEY types.ContextKey = "stagingSecondary" PATCH_BUILDING_MAIN_CONTEXT_KEY types.ContextKey = "patchBuilding" PATCH_BUILDING_SECONDARY_CONTEXT_KEY types.ContextKey = "patchBuildingSecondary" MERGE_CONFLICTS_CONTEXT_KEY types.ContextKey = "mergeConflicts" // these shouldn't really be needed for anything but I'm giving them unique keys nonetheless OPTIONS_CONTEXT_KEY types.ContextKey = "options" APP_STATUS_CONTEXT_KEY types.ContextKey = "appStatus" SEARCH_PREFIX_CONTEXT_KEY types.ContextKey = "searchPrefix" INFORMATION_CONTEXT_KEY types.ContextKey = "information" LIMIT_CONTEXT_KEY types.ContextKey = "limit" MENU_CONTEXT_KEY types.ContextKey = "menu" CONFIRMATION_CONTEXT_KEY types.ContextKey = "confirmation" SEARCH_CONTEXT_KEY types.ContextKey = "search" COMMIT_MESSAGE_CONTEXT_KEY types.ContextKey = "commitMessage" COMMIT_DESCRIPTION_CONTEXT_KEY types.ContextKey = "commitDescription" SUBMODULES_CONTEXT_KEY types.ContextKey = "submodules" SUGGESTIONS_CONTEXT_KEY types.ContextKey = "suggestions" COMMAND_LOG_CONTEXT_KEY types.ContextKey = "cmdLog" )
const HORIZONTAL_SCROLL_FACTOR = 3
const NoCommitIndex = -1
when selectedIndex (see below) is set to this value, it means that we're not currently viewing a commit message of an existing commit: instead we're making our own new commit message
Variables ¶
var AllContextKeys = []types.ContextKey{ GLOBAL_CONTEXT_KEY, STATUS_CONTEXT_KEY, FILES_CONTEXT_KEY, LOCAL_BRANCHES_CONTEXT_KEY, REMOTES_CONTEXT_KEY, WORKTREES_CONTEXT_KEY, REMOTE_BRANCHES_CONTEXT_KEY, TAGS_CONTEXT_KEY, LOCAL_COMMITS_CONTEXT_KEY, REFLOG_COMMITS_CONTEXT_KEY, SUB_COMMITS_CONTEXT_KEY, COMMIT_FILES_CONTEXT_KEY, STASH_CONTEXT_KEY, NORMAL_MAIN_CONTEXT_KEY, NORMAL_SECONDARY_CONTEXT_KEY, STAGING_MAIN_CONTEXT_KEY, STAGING_SECONDARY_CONTEXT_KEY, PATCH_BUILDING_MAIN_CONTEXT_KEY, PATCH_BUILDING_SECONDARY_CONTEXT_KEY, MERGE_CONFLICTS_CONTEXT_KEY, MENU_CONTEXT_KEY, CONFIRMATION_CONTEXT_KEY, SEARCH_CONTEXT_KEY, COMMIT_MESSAGE_CONTEXT_KEY, SUBMODULES_CONTEXT_KEY, SUGGESTIONS_CONTEXT_KEY, COMMAND_LOG_CONTEXT_KEY, }
Functions ¶
func NewDisplayContext ¶ added in v0.36.0
A Display context only renders a view. It has no keybindings and is not focusable.
Types ¶
type BaseContext ¶
type BaseContext struct { *ParentContextMgr // contains filtered or unexported fields }
func NewBaseContext ¶
func NewBaseContext(opts NewBaseContextOpts) *BaseContext
func (*BaseContext) AddKeybindingsFn ¶
func (self *BaseContext) AddKeybindingsFn(fn types.KeybindingsFn)
func (*BaseContext) AddMouseKeybindingsFn ¶
func (self *BaseContext) AddMouseKeybindingsFn(fn types.MouseKeybindingsFn)
func (*BaseContext) AddOnClickFn ¶
func (self *BaseContext) AddOnClickFn(fn func() error)
func (*BaseContext) AddOnFocusFn ¶ added in v0.39.0
func (self *BaseContext) AddOnFocusFn(fn onFocusFn)
func (*BaseContext) AddOnFocusLostFn ¶ added in v0.39.0
func (self *BaseContext) AddOnFocusLostFn(fn onFocusLostFn)
func (*BaseContext) AddOnRenderToMainFn ¶ added in v0.39.0
func (self *BaseContext) AddOnRenderToMainFn(fn func() error)
func (*BaseContext) GetKey ¶
func (self *BaseContext) GetKey() types.ContextKey
func (*BaseContext) GetKeybindings ¶
func (self *BaseContext) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding
func (*BaseContext) GetKind ¶
func (self *BaseContext) GetKind() types.ContextKind
func (*BaseContext) GetMouseKeybindings ¶
func (self *BaseContext) GetMouseKeybindings(opts types.KeybindingsOpts) []*gocui.ViewMouseBinding
func (*BaseContext) GetOnClick ¶
func (self *BaseContext) GetOnClick() func() error
func (*BaseContext) GetOnFocus ¶ added in v0.39.0
func (self *BaseContext) GetOnFocus() onFocusFn
func (*BaseContext) GetOnFocusLost ¶ added in v0.39.0
func (self *BaseContext) GetOnFocusLost() onFocusLostFn
func (*BaseContext) GetOnRenderToMain ¶ added in v0.39.0
func (self *BaseContext) GetOnRenderToMain() func() error
func (*BaseContext) GetOptionsMap ¶
func (self *BaseContext) GetOptionsMap() map[string]string
func (*BaseContext) GetView ¶ added in v0.36.0
func (self *BaseContext) GetView() *gocui.View
func (*BaseContext) GetViewName ¶
func (self *BaseContext) GetViewName() string
func (*BaseContext) GetViewTrait ¶ added in v0.36.0
func (self *BaseContext) GetViewTrait() types.IViewTrait
func (*BaseContext) GetWindowName ¶
func (self *BaseContext) GetWindowName() string
func (*BaseContext) HasControlledBounds ¶ added in v0.36.0
func (self *BaseContext) HasControlledBounds() bool
func (*BaseContext) IsFocusable ¶
func (self *BaseContext) IsFocusable() bool
func (*BaseContext) IsTransient ¶
func (self *BaseContext) IsTransient() bool
func (*BaseContext) SetWindowName ¶
func (self *BaseContext) SetWindowName(windowName string)
func (*BaseContext) Title ¶
func (self *BaseContext) Title() string
type BranchesContext ¶
type BranchesContext struct { *FilteredListViewModel[*models.Branch] *ListContextTrait }
func NewBranchesContext ¶
func NewBranchesContext(c *ContextCommon) *BranchesContext
func (*BranchesContext) GetDiffTerminals ¶ added in v0.39.0
func (self *BranchesContext) GetDiffTerminals() []string
func (*BranchesContext) GetSelectedItemId ¶
func (self *BranchesContext) GetSelectedItemId() string
func (*BranchesContext) GetSelectedRef ¶
func (self *BranchesContext) GetSelectedRef() types.Ref
func (*BranchesContext) ShowBranchHeadsInSubCommits ¶ added in v0.40.0
func (self *BranchesContext) ShowBranchHeadsInSubCommits() bool
type CommitFilesContext ¶
type CommitFilesContext struct { *filetree.CommitFileTreeViewModel *ListContextTrait *DynamicTitleBuilder *SearchTrait }
func NewCommitFilesContext ¶
func NewCommitFilesContext(c *ContextCommon) *CommitFilesContext
func (*CommitFilesContext) GetDiffTerminals ¶ added in v0.39.0
func (self *CommitFilesContext) GetDiffTerminals() []string
func (*CommitFilesContext) GetSelectedItemId ¶
func (self *CommitFilesContext) GetSelectedItemId() string
type CommitMessageContext ¶ added in v0.38.0
func NewCommitMessageContext ¶ added in v0.38.0
func NewCommitMessageContext( c *ContextCommon, ) *CommitMessageContext
func (*CommitMessageContext) GetHistoryMessage ¶ added in v0.38.0
func (self *CommitMessageContext) GetHistoryMessage() string
func (*CommitMessageContext) GetPreserveMessage ¶ added in v0.38.0
func (self *CommitMessageContext) GetPreserveMessage() bool
func (*CommitMessageContext) GetPreservedMessage ¶ added in v0.38.0
func (self *CommitMessageContext) GetPreservedMessage() string
func (*CommitMessageContext) GetSelectedIndex ¶ added in v0.38.0
func (self *CommitMessageContext) GetSelectedIndex() int
func (*CommitMessageContext) OnConfirm ¶ added in v0.38.0
func (self *CommitMessageContext) OnConfirm(summary string, description string) error
func (*CommitMessageContext) RenderCommitLength ¶ added in v0.39.0
func (self *CommitMessageContext) RenderCommitLength()
func (*CommitMessageContext) SetHistoryMessage ¶ added in v0.38.0
func (self *CommitMessageContext) SetHistoryMessage(message string)
func (*CommitMessageContext) SetPanelState ¶ added in v0.38.0
func (*CommitMessageContext) SetPreservedMessage ¶ added in v0.38.0
func (self *CommitMessageContext) SetPreservedMessage(message string)
func (*CommitMessageContext) SetSelectedIndex ¶ added in v0.38.0
func (self *CommitMessageContext) SetSelectedIndex(value int)
type CommitMessageViewModel ¶ added in v0.38.0
type CommitMessageViewModel struct {
// contains filtered or unexported fields
}
type ConfirmationContext ¶ added in v0.39.0
type ConfirmationContext struct { *SimpleContext State ConfirmationContextState // contains filtered or unexported fields }
func NewConfirmationContext ¶ added in v0.39.0
func NewConfirmationContext( c *ContextCommon, ) *ConfirmationContext
type ConfirmationContextState ¶ added in v0.39.0
type ConflictsViewModel ¶ added in v0.36.0
type ConflictsViewModel struct {
// contains filtered or unexported fields
}
type ContextCommon ¶ added in v0.39.0
type ContextCommon struct { *common.Common types.IGuiCommon }
type ContextTree ¶
type ContextTree struct { Global types.Context Status types.Context Snake types.Context Files *WorkingTreeContext Menu *MenuContext Branches *BranchesContext Tags *TagsContext LocalCommits *LocalCommitsContext CommitFiles *CommitFilesContext Remotes *RemotesContext Worktrees *WorktreesContext Submodules *SubmodulesContext RemoteBranches *RemoteBranchesContext ReflogCommits *ReflogCommitsContext SubCommits *SubCommitsContext Stash *StashContext Suggestions *SuggestionsContext Normal types.Context NormalSecondary types.Context Staging *PatchExplorerContext StagingSecondary *PatchExplorerContext CustomPatchBuilder *PatchExplorerContext CustomPatchBuilderSecondary types.Context MergeConflicts *MergeConflictsContext Confirmation *ConfirmationContext CommitMessage *CommitMessageContext CommitDescription types.Context CommandLog types.Context // display contexts AppStatus types.Context Options types.Context SearchPrefix types.Context Search types.Context Information types.Context Limit types.Context }
func NewContextTree ¶ added in v0.39.0
func NewContextTree(c *ContextCommon) *ContextTree
func (*ContextTree) Flatten ¶
func (self *ContextTree) Flatten() []types.Context
the order of this decides which context is initially at the top of its window
type DynamicTitleBuilder ¶
type DynamicTitleBuilder struct {
// contains filtered or unexported fields
}
func NewDynamicTitleBuilder ¶
func NewDynamicTitleBuilder(formatStr string) *DynamicTitleBuilder
func (*DynamicTitleBuilder) SetTitleRef ¶
func (self *DynamicTitleBuilder) SetTitleRef(titleRef string)
func (*DynamicTitleBuilder) Title ¶
func (self *DynamicTitleBuilder) Title() string
type FilteredList ¶ added in v0.39.0
type FilteredList[T any] struct { // contains filtered or unexported fields }
func NewFilteredList ¶ added in v0.39.0
func NewFilteredList[T any](getList func() []T, getFilterFields func(T) []string) *FilteredList[T]
func (*FilteredList[T]) ClearFilter ¶ added in v0.39.0
func (self *FilteredList[T]) ClearFilter()
func (*FilteredList[T]) GetFilter ¶ added in v0.39.0
func (self *FilteredList[T]) GetFilter() string
func (*FilteredList[T]) GetFilteredList ¶ added in v0.39.0
func (self *FilteredList[T]) GetFilteredList() []T
func (*FilteredList[T]) IsFiltering ¶ added in v0.39.0
func (self *FilteredList[T]) IsFiltering() bool
func (*FilteredList[T]) SetFilter ¶ added in v0.39.0
func (self *FilteredList[T]) SetFilter(filter string)
func (*FilteredList[T]) UnfilteredIndex ¶ added in v0.39.0
func (self *FilteredList[T]) UnfilteredIndex(index int) int
func (*FilteredList[T]) UnfilteredLen ¶ added in v0.39.0
func (self *FilteredList[T]) UnfilteredLen() int
TODO: update to just 'Len'
type FilteredListViewModel ¶ added in v0.39.0
type FilteredListViewModel[T any] struct { *FilteredList[T] *ListViewModel[T] }
func NewFilteredListViewModel ¶ added in v0.39.0
func NewFilteredListViewModel[T any](getList func() []T, getFilterFields func(T) []string) *FilteredListViewModel[T]
func (*FilteredListViewModel[T]) ClearFilter ¶ added in v0.39.0
func (self *FilteredListViewModel[T]) ClearFilter()
func (*FilteredListViewModel[T]) IsFilterableContext ¶ added in v0.39.0
func (self *FilteredListViewModel[T]) IsFilterableContext()
used for type switch
type ListContextTrait ¶
func (*ListContextTrait) FocusLine ¶
func (self *ListContextTrait) FocusLine()
func (*ListContextTrait) GetList ¶
func (self *ListContextTrait) GetList() types.IList
func (*ListContextTrait) HandleFocus ¶
func (self *ListContextTrait) HandleFocus(opts types.OnFocusOpts) error
func (*ListContextTrait) HandleFocusLost ¶
func (self *ListContextTrait) HandleFocusLost(opts types.OnFocusLostOpts) error
func (*ListContextTrait) HandleRender ¶
func (self *ListContextTrait) HandleRender() error
OnFocus assumes that the content of the context has already been rendered to the view. OnRender is the function which actually renders the content to the view
func (*ListContextTrait) IsListContext ¶ added in v0.39.0
func (self *ListContextTrait) IsListContext()
func (*ListContextTrait) OnSearchSelect ¶
func (self *ListContextTrait) OnSearchSelect(selectedLineIdx int) error
type ListViewModel ¶ added in v0.39.0
type ListViewModel[T any] struct { *traits.ListCursor // contains filtered or unexported fields }
func NewListViewModel ¶ added in v0.39.0
func NewListViewModel[T any](getModel func() []T) *ListViewModel[T]
func (*ListViewModel[T]) GetItems ¶ added in v0.39.0
func (self *ListViewModel[T]) GetItems() []T
func (*ListViewModel[T]) GetSelected ¶ added in v0.39.0
func (self *ListViewModel[T]) GetSelected() T
func (*ListViewModel[T]) Len ¶ added in v0.39.0
func (self *ListViewModel[T]) Len() int
type LocalCommitsContext ¶
type LocalCommitsContext struct { *LocalCommitsViewModel *ListContextTrait *SearchTrait }
func NewLocalCommitsContext ¶
func NewLocalCommitsContext(c *ContextCommon) *LocalCommitsContext
func (*LocalCommitsContext) CanRebase ¶
func (self *LocalCommitsContext) CanRebase() bool
func (*LocalCommitsContext) GetDiffTerminals ¶ added in v0.39.0
func (self *LocalCommitsContext) GetDiffTerminals() []string
func (*LocalCommitsContext) GetSelectedItemId ¶
func (self *LocalCommitsContext) GetSelectedItemId() string
func (*LocalCommitsContext) GetSelectedRef ¶
func (self *LocalCommitsContext) GetSelectedRef() types.Ref
type LocalCommitsViewModel ¶
type LocalCommitsViewModel struct { *ListViewModel[*models.Commit] // contains filtered or unexported fields }
func NewLocalCommitsViewModel ¶
func NewLocalCommitsViewModel(getModel func() []*models.Commit, c *ContextCommon) *LocalCommitsViewModel
func (*LocalCommitsViewModel) GetCommits ¶
func (self *LocalCommitsViewModel) GetCommits() []*models.Commit
func (*LocalCommitsViewModel) GetLimitCommits ¶
func (self *LocalCommitsViewModel) GetLimitCommits() bool
func (*LocalCommitsViewModel) GetShowWholeGitGraph ¶
func (self *LocalCommitsViewModel) GetShowWholeGitGraph() bool
func (*LocalCommitsViewModel) SetLimitCommits ¶
func (self *LocalCommitsViewModel) SetLimitCommits(value bool)
func (*LocalCommitsViewModel) SetShowWholeGitGraph ¶
func (self *LocalCommitsViewModel) SetShowWholeGitGraph(value bool)
type MenuContext ¶
type MenuContext struct { *MenuViewModel *ListContextTrait // contains filtered or unexported fields }
func NewMenuContext ¶
func NewMenuContext( c *ContextCommon, ) *MenuContext
func (*MenuContext) GetKeybindings ¶
func (self *MenuContext) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding
func (*MenuContext) GetSelectedItemId ¶
func (self *MenuContext) GetSelectedItemId() string
TODO: remove this thing.
func (*MenuContext) OnMenuPress ¶
func (self *MenuContext) OnMenuPress(selectedItem *types.MenuItem) error
type MenuViewModel ¶
type MenuViewModel struct { *FilteredListViewModel[*types.MenuItem] // contains filtered or unexported fields }
func NewMenuViewModel ¶
func NewMenuViewModel(c *ContextCommon) *MenuViewModel
func (*MenuViewModel) GetDisplayStrings ¶
func (self *MenuViewModel) GetDisplayStrings(_startIdx int, _length int) [][]string
TODO: move into presentation package
func (*MenuViewModel) SetMenuItems ¶
func (self *MenuViewModel) SetMenuItems(items []*types.MenuItem, columnAlignment []utils.Alignment)
type MergeConflictsContext ¶ added in v0.36.0
func NewMergeConflictsContext ¶ added in v0.36.0
func NewMergeConflictsContext( c *ContextCommon, ) *MergeConflictsContext
func (*MergeConflictsContext) FocusSelection ¶ added in v0.38.0
func (self *MergeConflictsContext) FocusSelection()
func (*MergeConflictsContext) GetContentToRender ¶ added in v0.36.0
func (self *MergeConflictsContext) GetContentToRender(isFocused bool) string
func (*MergeConflictsContext) GetMutex ¶ added in v0.36.0
func (self *MergeConflictsContext) GetMutex() *deadlock.Mutex
func (*MergeConflictsContext) GetOriginY ¶ added in v0.36.0
func (self *MergeConflictsContext) GetOriginY() int
func (*MergeConflictsContext) GetState ¶ added in v0.36.0
func (self *MergeConflictsContext) GetState() *mergeconflicts.State
func (*MergeConflictsContext) IsUserScrolling ¶ added in v0.36.0
func (self *MergeConflictsContext) IsUserScrolling() bool
func (*MergeConflictsContext) Render ¶ added in v0.36.0
func (self *MergeConflictsContext) Render(isFocused bool) error
func (*MergeConflictsContext) RenderAndFocus ¶ added in v0.36.0
func (self *MergeConflictsContext) RenderAndFocus(isFocused bool) error
func (*MergeConflictsContext) SetState ¶ added in v0.36.0
func (self *MergeConflictsContext) SetState(state *mergeconflicts.State)
func (*MergeConflictsContext) SetUserScrolling ¶ added in v0.36.0
func (self *MergeConflictsContext) SetUserScrolling(isScrolling bool)
type NewBaseContextOpts ¶
type ParentContextMgr ¶
type ParentContextMgr struct { ParentContext types.Context // contains filtered or unexported fields }
func (*ParentContextMgr) GetParentContext ¶
func (self *ParentContextMgr) GetParentContext() (types.Context, bool)
func (*ParentContextMgr) SetParentContext ¶
func (self *ParentContextMgr) SetParentContext(context types.Context)
type PatchExplorerContext ¶ added in v0.36.0
type PatchExplorerContext struct { *SimpleContext *SearchTrait // contains filtered or unexported fields }
func NewPatchExplorerContext ¶ added in v0.36.0
func NewPatchExplorerContext( view *gocui.View, windowName string, key types.ContextKey, getIncludedLineIndices func() []int, c *ContextCommon, ) *PatchExplorerContext
func (*PatchExplorerContext) Focus ¶ added in v0.36.0
func (self *PatchExplorerContext) Focus() error
func (*PatchExplorerContext) FocusSelection ¶ added in v0.38.0
func (self *PatchExplorerContext) FocusSelection()
func (*PatchExplorerContext) GetContentToRender ¶ added in v0.36.0
func (self *PatchExplorerContext) GetContentToRender(isFocused bool) string
func (*PatchExplorerContext) GetIncludedLineIndices ¶ added in v0.36.0
func (self *PatchExplorerContext) GetIncludedLineIndices() []int
func (*PatchExplorerContext) GetMutex ¶ added in v0.36.0
func (self *PatchExplorerContext) GetMutex() *deadlock.Mutex
func (*PatchExplorerContext) GetState ¶ added in v0.36.0
func (self *PatchExplorerContext) GetState() *patch_exploring.State
func (*PatchExplorerContext) GetViewTrait ¶ added in v0.36.0
func (self *PatchExplorerContext) GetViewTrait() types.IViewTrait
func (*PatchExplorerContext) IsPatchExplorerContext ¶ added in v0.39.0
func (self *PatchExplorerContext) IsPatchExplorerContext()
func (*PatchExplorerContext) NavigateTo ¶ added in v0.36.0
func (self *PatchExplorerContext) NavigateTo(isFocused bool, selectedLineIdx int) error
func (*PatchExplorerContext) Render ¶ added in v0.36.0
func (self *PatchExplorerContext) Render(isFocused bool) error
func (*PatchExplorerContext) RenderAndFocus ¶ added in v0.36.0
func (self *PatchExplorerContext) RenderAndFocus(isFocused bool) error
func (*PatchExplorerContext) SetState ¶ added in v0.36.0
func (self *PatchExplorerContext) SetState(state *patch_exploring.State)
type ReflogCommitsContext ¶
type ReflogCommitsContext struct { *FilteredListViewModel[*models.Commit] *ListContextTrait }
func NewReflogCommitsContext ¶
func NewReflogCommitsContext(c *ContextCommon) *ReflogCommitsContext
func (*ReflogCommitsContext) CanRebase ¶
func (self *ReflogCommitsContext) CanRebase() bool
func (*ReflogCommitsContext) GetCommits ¶
func (self *ReflogCommitsContext) GetCommits() []*models.Commit
func (*ReflogCommitsContext) GetDiffTerminals ¶ added in v0.39.0
func (self *ReflogCommitsContext) GetDiffTerminals() []string
func (*ReflogCommitsContext) GetSelectedItemId ¶
func (self *ReflogCommitsContext) GetSelectedItemId() string
func (*ReflogCommitsContext) GetSelectedRef ¶
func (self *ReflogCommitsContext) GetSelectedRef() types.Ref
func (*ReflogCommitsContext) ShowBranchHeadsInSubCommits ¶ added in v0.40.0
func (self *ReflogCommitsContext) ShowBranchHeadsInSubCommits() bool
type RemoteBranchesContext ¶
type RemoteBranchesContext struct { *FilteredListViewModel[*models.RemoteBranch] *ListContextTrait *DynamicTitleBuilder }
func NewRemoteBranchesContext ¶
func NewRemoteBranchesContext( c *ContextCommon, ) *RemoteBranchesContext
func (*RemoteBranchesContext) GetDiffTerminals ¶ added in v0.39.0
func (self *RemoteBranchesContext) GetDiffTerminals() []string
func (*RemoteBranchesContext) GetSelectedItemId ¶
func (self *RemoteBranchesContext) GetSelectedItemId() string
func (*RemoteBranchesContext) GetSelectedRef ¶
func (self *RemoteBranchesContext) GetSelectedRef() types.Ref
func (*RemoteBranchesContext) ShowBranchHeadsInSubCommits ¶ added in v0.40.0
func (self *RemoteBranchesContext) ShowBranchHeadsInSubCommits() bool
type RemotesContext ¶
type RemotesContext struct { *FilteredListViewModel[*models.Remote] *ListContextTrait }
func NewRemotesContext ¶
func NewRemotesContext(c *ContextCommon) *RemotesContext
func (*RemotesContext) GetDiffTerminals ¶ added in v0.39.0
func (self *RemotesContext) GetDiffTerminals() []string
func (*RemotesContext) GetSelectedItemId ¶
func (self *RemotesContext) GetSelectedItemId() string
type SearchTrait ¶ added in v0.39.0
type SearchTrait struct {
// contains filtered or unexported fields
}
func NewSearchTrait ¶ added in v0.39.0
func NewSearchTrait(c *ContextCommon) *SearchTrait
func (*SearchTrait) ClearSearchString ¶ added in v0.39.0
func (self *SearchTrait) ClearSearchString()
func (*SearchTrait) GetSearchString ¶ added in v0.39.0
func (self *SearchTrait) GetSearchString() string
func (*SearchTrait) IsSearchableContext ¶ added in v0.39.0
func (self *SearchTrait) IsSearchableContext()
used for type switch
func (*SearchTrait) IsSearching ¶ added in v0.39.0
func (self *SearchTrait) IsSearching() bool
func (*SearchTrait) SetSearchString ¶ added in v0.39.0
func (self *SearchTrait) SetSearchString(searchString string)
type SimpleContext ¶
type SimpleContext struct {
*BaseContext
}
func NewSimpleContext ¶
func NewSimpleContext(baseContext *BaseContext) *SimpleContext
func (*SimpleContext) HandleFocus ¶
func (self *SimpleContext) HandleFocus(opts types.OnFocusOpts) error
func (*SimpleContext) HandleFocusLost ¶
func (self *SimpleContext) HandleFocusLost(opts types.OnFocusLostOpts) error
func (*SimpleContext) HandleRender ¶
func (self *SimpleContext) HandleRender() error
func (*SimpleContext) HandleRenderToMain ¶
func (self *SimpleContext) HandleRenderToMain() error
type StashContext ¶
type StashContext struct { *FilteredListViewModel[*models.StashEntry] *ListContextTrait }
func NewStashContext ¶
func NewStashContext( c *ContextCommon, ) *StashContext
func (*StashContext) CanRebase ¶
func (self *StashContext) CanRebase() bool
func (*StashContext) GetDiffTerminals ¶ added in v0.39.0
func (self *StashContext) GetDiffTerminals() []string
func (*StashContext) GetSelectedItemId ¶
func (self *StashContext) GetSelectedItemId() string
func (*StashContext) GetSelectedRef ¶
func (self *StashContext) GetSelectedRef() types.Ref
type SubCommitsContext ¶
type SubCommitsContext struct { *SubCommitsViewModel *ListContextTrait *DynamicTitleBuilder *SearchTrait // contains filtered or unexported fields }
func NewSubCommitsContext ¶
func NewSubCommitsContext( c *ContextCommon, ) *SubCommitsContext
func (*SubCommitsContext) CanRebase ¶
func (self *SubCommitsContext) CanRebase() bool
func (*SubCommitsContext) GetCommits ¶
func (self *SubCommitsContext) GetCommits() []*models.Commit
func (*SubCommitsContext) GetDiffTerminals ¶ added in v0.39.0
func (self *SubCommitsContext) GetDiffTerminals() []string
func (*SubCommitsContext) GetLimitCommits ¶ added in v0.38.0
func (self *SubCommitsContext) GetLimitCommits() bool
func (*SubCommitsContext) GetSelectedItemId ¶
func (self *SubCommitsContext) GetSelectedItemId() string
func (*SubCommitsContext) GetSelectedRef ¶
func (self *SubCommitsContext) GetSelectedRef() types.Ref
func (*SubCommitsContext) SetLimitCommits ¶ added in v0.38.0
func (self *SubCommitsContext) SetLimitCommits(value bool)
func (*SubCommitsContext) Title ¶
func (self *SubCommitsContext) Title() string
type SubCommitsViewModel ¶
type SubCommitsViewModel struct { *ListViewModel[*models.Commit] // contains filtered or unexported fields }
func (*SubCommitsViewModel) GetRef ¶ added in v0.38.0
func (self *SubCommitsViewModel) GetRef() types.Ref
func (*SubCommitsViewModel) GetShowBranchHeads ¶ added in v0.40.0
func (self *SubCommitsViewModel) GetShowBranchHeads() bool
func (*SubCommitsViewModel) SetRef ¶ added in v0.38.0
func (self *SubCommitsViewModel) SetRef(ref types.Ref)
func (*SubCommitsViewModel) SetShowBranchHeads ¶ added in v0.40.0
func (self *SubCommitsViewModel) SetShowBranchHeads(value bool)
type SubmodulesContext ¶
type SubmodulesContext struct { *FilteredListViewModel[*models.SubmoduleConfig] *ListContextTrait }
func NewSubmodulesContext ¶
func NewSubmodulesContext(c *ContextCommon) *SubmodulesContext
func (*SubmodulesContext) GetSelectedItemId ¶
func (self *SubmodulesContext) GetSelectedItemId() string
type SuggestionsContext ¶
type SuggestionsContext struct { *ListViewModel[*types.Suggestion] *ListContextTrait State *SuggestionsContextState }
func NewSuggestionsContext ¶
func NewSuggestionsContext( c *ContextCommon, ) *SuggestionsContext
func (*SuggestionsContext) GetSelectedItemId ¶
func (self *SuggestionsContext) GetSelectedItemId() string
func (*SuggestionsContext) RefreshSuggestions ¶ added in v0.39.0
func (self *SuggestionsContext) RefreshSuggestions()
func (*SuggestionsContext) SetSuggestions ¶ added in v0.39.0
func (self *SuggestionsContext) SetSuggestions(suggestions []*types.Suggestion)
type SuggestionsContextState ¶ added in v0.39.0
type SuggestionsContextState struct { Suggestions []*types.Suggestion OnConfirm func() error OnClose func() error AsyncHandler *tasks.AsyncHandler // FindSuggestions will take a string that the user has typed into a prompt // and return a slice of suggestions which match that string. FindSuggestions func(string) []*types.Suggestion }
type TagsContext ¶
type TagsContext struct { *FilteredListViewModel[*models.Tag] *ListContextTrait }
func NewTagsContext ¶
func NewTagsContext( c *ContextCommon, ) *TagsContext
func (*TagsContext) GetDiffTerminals ¶ added in v0.39.0
func (self *TagsContext) GetDiffTerminals() []string
func (*TagsContext) GetSelectedItemId ¶
func (self *TagsContext) GetSelectedItemId() string
func (*TagsContext) GetSelectedRef ¶
func (self *TagsContext) GetSelectedRef() types.Ref
func (*TagsContext) ShowBranchHeadsInSubCommits ¶ added in v0.40.0
func (self *TagsContext) ShowBranchHeadsInSubCommits() bool
type ViewTrait ¶
type ViewTrait struct {
// contains filtered or unexported fields
}
func NewViewTrait ¶
func (*ViewTrait) FocusPoint ¶
func (*ViewTrait) ScrollDown ¶
func (*ViewTrait) ScrollLeft ¶
func (self *ViewTrait) ScrollLeft()
func (*ViewTrait) ScrollRight ¶
func (self *ViewTrait) ScrollRight()
func (*ViewTrait) SelectedLineIdx ¶
func (*ViewTrait) SetContent ¶
func (*ViewTrait) SetHighlight ¶
func (*ViewTrait) SetOriginX ¶
func (*ViewTrait) SetViewPortContent ¶
func (*ViewTrait) ViewPortYBounds ¶
tells us the start of line indexes shown in the view currently as well as the capacity of lines shown in the viewport.
type WorkingTreeContext ¶
type WorkingTreeContext struct { *filetree.FileTreeViewModel *ListContextTrait *SearchTrait }
func NewWorkingTreeContext ¶
func NewWorkingTreeContext(c *ContextCommon) *WorkingTreeContext
func (*WorkingTreeContext) GetSelectedItemId ¶
func (self *WorkingTreeContext) GetSelectedItemId() string
type WorktreesContext ¶ added in v0.40.0
type WorktreesContext struct { *FilteredListViewModel[*models.Worktree] *ListContextTrait }
func NewWorktreesContext ¶ added in v0.40.0
func NewWorktreesContext(c *ContextCommon) *WorktreesContext
func (*WorktreesContext) GetSelectedItemId ¶ added in v0.40.0
func (self *WorktreesContext) GetSelectedItemId() string
Source Files ¶
- base_context.go
- branches_context.go
- commit_files_context.go
- commit_message_context.go
- confirmation_context.go
- context.go
- context_common.go
- dynamic_title_builder.go
- filtered_list.go
- filtered_list_view_model.go
- list_context_trait.go
- list_view_model.go
- local_commits_context.go
- menu_context.go
- merge_conflicts_context.go
- parent_context_mgr.go
- patch_explorer_context.go
- reflog_commits_context.go
- remote_branches_context.go
- remotes_context.go
- search_trait.go
- setup.go
- simple_context.go
- stash_context.go
- sub_commits_context.go
- submodules_context.go
- suggestions_context.go
- tags_context.go
- view_trait.go
- working_tree_context.go
- worktrees_context.go