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) 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) 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 BasicViewModel
- type BranchesContext
- type CommitFilesContext
- type ConflictsViewModel
- type ContextCallbackOpts
- type ContextTree
- type DynamicTitleBuilder
- 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) OnSearchSelect(selectedLineIdx int) error
- 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) 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) 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) 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
- type RemoteBranchesContext
- type RemotesContext
- type SimpleContext
- type StashContext
- type SubCommitsContext
- type SubCommitsViewModel
- type SubmodulesContext
- type SuggestionsContext
- 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 ViewportListContextTrait
- type WorkingTreeContext
Constants ¶
View Source
const ( GLOBAL_CONTEXT_KEY types.ContextKey = "global" STATUS_CONTEXT_KEY types.ContextKey = "status" FILES_CONTEXT_KEY types.ContextKey = "files" LOCAL_BRANCHES_CONTEXT_KEY types.ContextKey = "localBranches" REMOTES_CONTEXT_KEY types.ContextKey = "remotes" 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" SUBMODULES_CONTEXT_KEY types.ContextKey = "submodules" SUGGESTIONS_CONTEXT_KEY types.ContextKey = "suggestions" COMMAND_LOG_CONTEXT_KEY types.ContextKey = "cmdLog" )
View Source
const HORIZONTAL_SCROLL_FACTOR = 3
Variables ¶
View Source
var AllContextKeys = []types.ContextKey{ GLOBAL_CONTEXT_KEY, STATUS_CONTEXT_KEY, FILES_CONTEXT_KEY, LOCAL_BRANCHES_CONTEXT_KEY, REMOTES_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) 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) 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 BasicViewModel ¶
type BasicViewModel[T any] struct { *traits.ListCursor // contains filtered or unexported fields }
func NewBasicViewModel ¶
func NewBasicViewModel[T any](getModel func() []T) *BasicViewModel[T]
func (*BasicViewModel[T]) GetSelected ¶
func (self *BasicViewModel[T]) GetSelected() T
func (*BasicViewModel[T]) Len ¶
func (self *BasicViewModel[T]) Len() int
type BranchesContext ¶
type BranchesContext struct { *BasicViewModel[*models.Branch] *ListContextTrait }
func NewBranchesContext ¶
func NewBranchesContext( getModel func() []*models.Branch, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *BranchesContext
func (*BranchesContext) GetSelectedItemId ¶
func (self *BranchesContext) GetSelectedItemId() string
func (*BranchesContext) GetSelectedRef ¶
func (self *BranchesContext) GetSelectedRef() types.Ref
type CommitFilesContext ¶
type CommitFilesContext struct { *filetree.CommitFileTreeViewModel *ListContextTrait *DynamicTitleBuilder }
func NewCommitFilesContext ¶
func NewCommitFilesContext( getModel func() []*models.CommitFile, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *CommitFilesContext
func (*CommitFilesContext) GetSelectedItemId ¶
func (self *CommitFilesContext) GetSelectedItemId() string
type ConflictsViewModel ¶ added in v0.36.0
type ConflictsViewModel struct {
// contains filtered or unexported fields
}
type ContextCallbackOpts ¶
type ContextCallbackOpts struct { OnFocus func(opts types.OnFocusOpts) error OnFocusLost func(opts types.OnFocusLostOpts) error OnRender func() error OnRenderToMain func() error }
type ContextTree ¶
type ContextTree struct { Global types.Context Status types.Context Files *WorkingTreeContext Menu *MenuContext Branches *BranchesContext Tags *TagsContext LocalCommits *LocalCommitsContext CommitFiles *CommitFilesContext Remotes *RemotesContext 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 types.Context CommitMessage 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 (*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 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) OnSearchSelect ¶
func (self *ListContextTrait) OnSearchSelect(selectedLineIdx int) error
type LocalCommitsContext ¶
type LocalCommitsContext struct { *LocalCommitsViewModel *ViewportListContextTrait }
func NewLocalCommitsContext ¶
func NewLocalCommitsContext( getModel func() []*models.Commit, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *LocalCommitsContext
func (*LocalCommitsContext) CanRebase ¶
func (self *LocalCommitsContext) CanRebase() bool
func (*LocalCommitsContext) GetSelectedItemId ¶
func (self *LocalCommitsContext) GetSelectedItemId() string
func (*LocalCommitsContext) GetSelectedRef ¶
func (self *LocalCommitsContext) GetSelectedRef() types.Ref
type LocalCommitsViewModel ¶
type LocalCommitsViewModel struct { *BasicViewModel[*models.Commit] // contains filtered or unexported fields }
func NewLocalCommitsViewModel ¶
func NewLocalCommitsViewModel(getModel func() []*models.Commit, c *types.HelperCommon) *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 }
func NewMenuContext ¶
func NewMenuContext( view *gocui.View, c *types.HelperCommon, getOptionsMap func() map[string]string, renderToDescriptionView func(string), ) *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 { *BasicViewModel[*types.MenuItem] // contains filtered or unexported fields }
func NewMenuViewModel ¶
func NewMenuViewModel() *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)
type MergeConflictsContext ¶ added in v0.36.0
func NewMergeConflictsContext ¶ added in v0.36.0
func NewMergeConflictsContext( view *gocui.View, opts ContextCallbackOpts, c *types.HelperCommon, getOptionsMap func() map[string]string, ) *MergeConflictsContext
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 // contains filtered or unexported fields }
func NewPatchExplorerContext ¶ added in v0.36.0
func NewPatchExplorerContext( view *gocui.View, windowName string, key types.ContextKey, onFocus func(types.OnFocusOpts) error, onFocusLost func(opts types.OnFocusLostOpts) error, getIncludedLineIndices func() []int, c *types.HelperCommon, ) *PatchExplorerContext
func (*PatchExplorerContext) Focus ¶ added in v0.36.0
func (self *PatchExplorerContext) Focus() error
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) 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 { *BasicViewModel[*models.Commit] *ListContextTrait }
func NewReflogCommitsContext ¶
func NewReflogCommitsContext( getModel func() []*models.Commit, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *ReflogCommitsContext
func (*ReflogCommitsContext) CanRebase ¶
func (self *ReflogCommitsContext) CanRebase() bool
func (*ReflogCommitsContext) GetCommits ¶
func (self *ReflogCommitsContext) GetCommits() []*models.Commit
func (*ReflogCommitsContext) GetSelectedItemId ¶
func (self *ReflogCommitsContext) GetSelectedItemId() string
func (*ReflogCommitsContext) GetSelectedRef ¶
func (self *ReflogCommitsContext) GetSelectedRef() types.Ref
type RemoteBranchesContext ¶
type RemoteBranchesContext struct { *BasicViewModel[*models.RemoteBranch] *ListContextTrait *DynamicTitleBuilder }
func NewRemoteBranchesContext ¶
func NewRemoteBranchesContext( getModel func() []*models.RemoteBranch, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *RemoteBranchesContext
func (*RemoteBranchesContext) GetSelectedItemId ¶
func (self *RemoteBranchesContext) GetSelectedItemId() string
func (*RemoteBranchesContext) GetSelectedRef ¶
func (self *RemoteBranchesContext) GetSelectedRef() types.Ref
type RemotesContext ¶
type RemotesContext struct { *BasicViewModel[*models.Remote] *ListContextTrait }
func NewRemotesContext ¶
func NewRemotesContext( getModel func() []*models.Remote, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *RemotesContext
func (*RemotesContext) GetSelectedItemId ¶
func (self *RemotesContext) GetSelectedItemId() string
type SimpleContext ¶
type SimpleContext struct { OnFocus func(opts types.OnFocusOpts) error OnFocusLost func(opts types.OnFocusLostOpts) error OnRender func() error // this is for pushing some content to the main view OnRenderToMain func() error *BaseContext }
func NewSimpleContext ¶
func NewSimpleContext(baseContext *BaseContext, opts ContextCallbackOpts) *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 { *BasicViewModel[*models.StashEntry] *ListContextTrait }
func NewStashContext ¶
func NewStashContext( getModel func() []*models.StashEntry, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *StashContext
func (*StashContext) CanRebase ¶
func (self *StashContext) CanRebase() bool
func (*StashContext) GetSelectedItemId ¶
func (self *StashContext) GetSelectedItemId() string
func (*StashContext) GetSelectedRef ¶
func (self *StashContext) GetSelectedRef() types.Ref
type SubCommitsContext ¶
type SubCommitsContext struct { *SubCommitsViewModel *ViewportListContextTrait *DynamicTitleBuilder }
func NewSubCommitsContext ¶
func NewSubCommitsContext( getModel func() []*models.Commit, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *SubCommitsContext
func (*SubCommitsContext) CanRebase ¶
func (self *SubCommitsContext) CanRebase() bool
func (*SubCommitsContext) GetCommits ¶
func (self *SubCommitsContext) GetCommits() []*models.Commit
func (*SubCommitsContext) GetSelectedItemId ¶
func (self *SubCommitsContext) GetSelectedItemId() string
func (*SubCommitsContext) GetSelectedRef ¶
func (self *SubCommitsContext) GetSelectedRef() types.Ref
func (*SubCommitsContext) Title ¶
func (self *SubCommitsContext) Title() string
type SubCommitsViewModel ¶
type SubCommitsViewModel struct { *BasicViewModel[*models.Commit] // contains filtered or unexported fields }
func (*SubCommitsViewModel) SetRefName ¶
func (self *SubCommitsViewModel) SetRefName(refName string)
type SubmodulesContext ¶
type SubmodulesContext struct { *BasicViewModel[*models.SubmoduleConfig] *ListContextTrait }
func NewSubmodulesContext ¶
func NewSubmodulesContext( getModel func() []*models.SubmoduleConfig, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *SubmodulesContext
func (*SubmodulesContext) GetSelectedItemId ¶
func (self *SubmodulesContext) GetSelectedItemId() string
type SuggestionsContext ¶
type SuggestionsContext struct { *BasicViewModel[*types.Suggestion] *ListContextTrait }
func NewSuggestionsContext ¶
func NewSuggestionsContext( getModel func() []*types.Suggestion, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *SuggestionsContext
func (*SuggestionsContext) GetSelectedItemId ¶
func (self *SuggestionsContext) GetSelectedItemId() string
type TagsContext ¶
type TagsContext struct { *BasicViewModel[*models.Tag] *ListContextTrait }
func NewTagsContext ¶
func NewTagsContext( getModel func() []*models.Tag, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *TagsContext
func (*TagsContext) GetSelectedItemId ¶
func (self *TagsContext) GetSelectedItemId() string
func (*TagsContext) GetSelectedRef ¶
func (self *TagsContext) GetSelectedRef() types.Ref
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 ViewportListContextTrait ¶
type ViewportListContextTrait struct {
*ListContextTrait
}
func (*ViewportListContextTrait) FocusLine ¶
func (self *ViewportListContextTrait) FocusLine()
type WorkingTreeContext ¶
type WorkingTreeContext struct { *filetree.FileTreeViewModel *ListContextTrait }
func NewWorkingTreeContext ¶
func NewWorkingTreeContext( getModel func() []*models.File, view *gocui.View, getDisplayStrings func(startIdx int, length int) [][]string, onFocus func(types.OnFocusOpts) error, onRenderToMain func() error, onFocusLost func(opts types.OnFocusLostOpts) error, c *types.HelperCommon, ) *WorkingTreeContext
func (*WorkingTreeContext) GetSelectedItemId ¶
func (self *WorkingTreeContext) GetSelectedItemId() string
Source Files
¶
- base_context.go
- basic_view_model.go
- branches_context.go
- commit_files_context.go
- context.go
- dynamic_title_builder.go
- list_context_trait.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
- simple_context.go
- stash_context.go
- sub_commits_context.go
- submodules_context.go
- suggestions_context.go
- tags_context.go
- view_trait.go
- viewport_list_context_trait.go
- working_tree_context.go
Click to show internal directories.
Click to hide internal directories.