helpers

package
v0.0.0-...-00ab8b8 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REBASE_OPTION_CONTINUE string = "continue"
	REBASE_OPTION_ABORT    string = "abort"
	REBASE_OPTION_SKIP     string = "skip"
)

Variables

This section is empty.

Functions

func FuzzySearchFunc

func FuzzySearchFunc(options []string) func(string) []*types.Suggestion

func GetWindowDimensions

func GetWindowDimensions(args WindowArrangementArgs) map[string]boxlayout.Dimensions

func MergeMaps

func MergeMaps[K comparable, V any](maps ...map[K]V) map[K]V

func SanitizedBranchName

func SanitizedBranchName(input string) string

SanitizedBranchName will remove all spaces in favor of a dash "-" to meet git's branch naming requirement.

func TryRemoveHardLineBreaks

func TryRemoveHardLineBreaks(message string, autoWrapWidth int) string

Types

type AmendHelper

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

func NewAmendHelper

func NewAmendHelper(
	c *HelperCommon,
	gpg *GpgHelper,
) *AmendHelper

func (*AmendHelper) AmendHead

func (self *AmendHelper) AmendHead() error

type AppStatusHelper

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

func NewAppStatusHelper

func NewAppStatusHelper(c *HelperCommon, statusMgr func() *status.StatusManager, modeHelper *ModeHelper) *AppStatusHelper

func (*AppStatusHelper) GetStatusString

func (self *AppStatusHelper) GetStatusString() string

func (*AppStatusHelper) HasStatus

func (self *AppStatusHelper) HasStatus() bool

func (*AppStatusHelper) Toast

func (self *AppStatusHelper) Toast(message string, kind types.ToastKind)

func (*AppStatusHelper) WithWaitingStatus

func (self *AppStatusHelper) WithWaitingStatus(message string, f func(gocui.Task) error)

withWaitingStatus wraps a function and shows a waiting status while the function is still executing

func (*AppStatusHelper) WithWaitingStatusSync

func (self *AppStatusHelper) WithWaitingStatusSync(message string, f func() error)

type BisectHelper

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

func NewBisectHelper

func NewBisectHelper(c *HelperCommon) *BisectHelper

func (*BisectHelper) PostBisectCommandRefresh

func (self *BisectHelper) PostBisectCommandRefresh() error

func (*BisectHelper) Reset

func (self *BisectHelper) Reset() error

type BranchesHelper

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

func NewBranchesHelper

func NewBranchesHelper(c *HelperCommon) *BranchesHelper

func (*BranchesHelper) ConfirmDeleteRemote

func (self *BranchesHelper) ConfirmDeleteRemote(remoteName string, branchName string) error

type CherryPickHelper

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

func NewCherryPickHelper

func NewCherryPickHelper(
	c *HelperCommon,
	rebaseHelper *MergeAndRebaseHelper,
) *CherryPickHelper

func (*CherryPickHelper) CanPaste

func (self *CherryPickHelper) CanPaste() bool

func (*CherryPickHelper) CopyRange

func (self *CherryPickHelper) CopyRange(commitsList []*models.Commit, context types.IListContext) error

func (*CherryPickHelper) Paste

func (self *CherryPickHelper) Paste() error

HandlePasteCommits begins a cherry-pick rebase with the commits the user has copied. Only to be called from the branch commits controller

func (*CherryPickHelper) Reset

func (self *CherryPickHelper) Reset() error

type CommitsHelper

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

func NewCommitsHelper

func NewCommitsHelper(
	c *HelperCommon,
	getCommitSummary func() string,
	setCommitSummary func(string),
	getCommitDescription func() string,
	getUnwrappedCommitDescription func() string,
	setCommitDescription func(string),
) *CommitsHelper

func (*CommitsHelper) CloseCommitMessagePanel

func (self *CommitsHelper) CloseCommitMessagePanel() error

func (*CommitsHelper) HandleCommitConfirm

func (self *CommitsHelper) HandleCommitConfirm() error

func (*CommitsHelper) JoinCommitMessageAndUnwrappedDescription

func (self *CommitsHelper) JoinCommitMessageAndUnwrappedDescription() string

func (*CommitsHelper) OnCommitSuccess

func (self *CommitsHelper) OnCommitSuccess()

func (*CommitsHelper) OpenCommitMenu

func (self *CommitsHelper) OpenCommitMenu(suggestionFunc func(string) []*types.Suggestion) error

func (*CommitsHelper) OpenCommitMessagePanel

func (self *CommitsHelper) OpenCommitMessagePanel(opts *OpenCommitMessagePanelOpts) error

func (*CommitsHelper) PopCommitMessageContexts

func (self *CommitsHelper) PopCommitMessageContexts() error

func (*CommitsHelper) SetMessageAndDescriptionInView

func (self *CommitsHelper) SetMessageAndDescriptionInView(message string)

func (*CommitsHelper) SplitCommitMessageAndDescription

func (self *CommitsHelper) SplitCommitMessageAndDescription(message string) (string, string)

func (*CommitsHelper) SwitchToEditor

func (self *CommitsHelper) SwitchToEditor() error

func (*CommitsHelper) UpdateCommitPanelView

func (self *CommitsHelper) UpdateCommitPanelView(message string)

type ConfirmationHelper

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

func NewConfirmationHelper

func NewConfirmationHelper(c *HelperCommon) *ConfirmationHelper

func (*ConfirmationHelper) CreatePopupPanel

func (self *ConfirmationHelper) CreatePopupPanel(ctx goContext.Context, opts types.CreatePopupPanelOpts) error

func (*ConfirmationHelper) DeactivateConfirmationPrompt

func (self *ConfirmationHelper) DeactivateConfirmationPrompt()

func (*ConfirmationHelper) IsPopupPanel

func (self *ConfirmationHelper) IsPopupPanel(viewName string) bool

func (*ConfirmationHelper) IsPopupPanelFocused

func (self *ConfirmationHelper) IsPopupPanelFocused() bool

func (*ConfirmationHelper) ResizeCommitMessagePanels

func (self *ConfirmationHelper) ResizeCommitMessagePanels()

func (*ConfirmationHelper) ResizeConfirmationPanel

func (self *ConfirmationHelper) ResizeConfirmationPanel()

func (*ConfirmationHelper) ResizeCurrentPopupPanel

func (self *ConfirmationHelper) ResizeCurrentPopupPanel() error

func (*ConfirmationHelper) ResizePopupPanel

func (self *ConfirmationHelper) ResizePopupPanel(v *gocui.View, content string) error

func (*ConfirmationHelper) TooltipForMenuItem

func (self *ConfirmationHelper) TooltipForMenuItem(menuItem *types.MenuItem) string

type CredentialsHelper

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

func NewCredentialsHelper

func NewCredentialsHelper(
	c *HelperCommon,
) *CredentialsHelper

func (*CredentialsHelper) PromptUserForCredential

func (self *CredentialsHelper) PromptUserForCredential(passOrUname oscommands.CredentialType) <-chan string

promptUserForCredential wait for a username, password or passphrase input from the credentials popup We return a channel rather than returning the string directly so that the calling function knows when the prompt has been created (before the user has entered anything) so that it can note that we're now waiting on user input and lazygit isn't processing anything.

type DiffHelper

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

func NewDiffHelper

func NewDiffHelper(c *HelperCommon) *DiffHelper

func (*DiffHelper) CurrentDiffTerminals

func (self *DiffHelper) CurrentDiffTerminals() []string

CurrentDiffTerminals returns the current diff terminals of the currently selected item. in the case of a branch it returns both the branch and it's upstream name, which becomes an option when you bring up the diff menu, but when you're just flicking through branches it will be using the local branch name.

func (*DiffHelper) DiffArgs

func (self *DiffHelper) DiffArgs() []string

func (*DiffHelper) ExitDiffMode

func (self *DiffHelper) ExitDiffMode() error

func (*DiffHelper) IgnoringWhitespaceSubTitle

func (self *DiffHelper) IgnoringWhitespaceSubTitle() string

func (*DiffHelper) RenderDiff

func (self *DiffHelper) RenderDiff() error

func (*DiffHelper) WithDiffModeCheck

func (self *DiffHelper) WithDiffModeCheck(f func() error) error

type FilesHelper

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

func NewFilesHelper

func NewFilesHelper(c *HelperCommon) *FilesHelper

func (*FilesHelper) EditFile

func (self *FilesHelper) EditFile(filename string) error

func (*FilesHelper) EditFileAtLine

func (self *FilesHelper) EditFileAtLine(filename string, lineNumber int) error

func (*FilesHelper) EditFileAtLineAndWait

func (self *FilesHelper) EditFileAtLineAndWait(filename string, lineNumber int) error

func (*FilesHelper) OpenDirInEditor

func (self *FilesHelper) OpenDirInEditor(path string) error

func (*FilesHelper) OpenFile

func (self *FilesHelper) OpenFile(filename string) error

type FixupHelper

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

func NewFixupHelper

func NewFixupHelper(
	c *HelperCommon,
) *FixupHelper

func (*FixupHelper) HandleFindBaseCommitForFixupPress

func (self *FixupHelper) HandleFindBaseCommitForFixupPress() error

type GpgHelper

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

func NewGpgHelper

func NewGpgHelper(c *HelperCommon) *GpgHelper

func (*GpgHelper) WithGpgHandling

func (self *GpgHelper) WithGpgHandling(cmdObj oscommands.ICmdObj, waitingStatus string, onSuccess func() error) error

Currently there is a bug where if we switch to a subprocess from within WithWaitingStatus we get stuck there and can't return to lazygit. We could fix this bug, or just stop running subprocesses from within there, given that we don't need to see a loading status if we're in a subprocess.

type HelperCommon

type HelperCommon struct {
	*common.Common
	types.IGuiCommon
	IGetContexts
}

type Helpers

type Helpers struct {
	Refs           *RefsHelper
	Bisect         *BisectHelper
	Suggestions    *SuggestionsHelper
	Files          *FilesHelper
	WorkingTree    *WorkingTreeHelper
	BranchesHelper *BranchesHelper
	Tags           *TagsHelper
	MergeAndRebase *MergeAndRebaseHelper
	MergeConflicts *MergeConflictsHelper
	CherryPick     *CherryPickHelper
	Host           *HostHelper
	PatchBuilding  *PatchBuildingHelper
	Staging        *StagingHelper
	GPG            *GpgHelper
	Upstream       *UpstreamHelper
	AmendHelper    *AmendHelper
	FixupHelper    *FixupHelper
	Commits        *CommitsHelper
	Snake          *SnakeHelper
	// lives in context package because our contexts need it to render to main
	Diff              *DiffHelper
	Repos             *ReposHelper
	RecordDirectory   *RecordDirectoryHelper
	Update            *UpdateHelper
	Window            *WindowHelper
	View              *ViewHelper
	Refresh           *RefreshHelper
	Confirmation      *ConfirmationHelper
	Mode              *ModeHelper
	AppStatus         *AppStatusHelper
	InlineStatus      *InlineStatusHelper
	WindowArrangement *WindowArrangementHelper
	Search            *SearchHelper
	Worktree          *WorktreeHelper
	SubCommits        *SubCommitsHelper
}

func NewStubHelpers

func NewStubHelpers() *Helpers

type HostHelper

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

func NewHostHelper

func NewHostHelper(
	c *HelperCommon,
) *HostHelper

func (*HostHelper) GetCommitURL

func (self *HostHelper) GetCommitURL(commitSha string) (string, error)

func (*HostHelper) GetPullRequestURL

func (self *HostHelper) GetPullRequestURL(from string, to string) (string, error)

type ICommitsHelper

type ICommitsHelper interface {
	UpdateCommitPanelView(message string)
}

type IFilesHelper

type IFilesHelper interface {
	EditFile(filename string) error
	EditFileAtLine(filename string, lineNumber int) error
	OpenFile(filename string) error
}

type IGetContexts

type IGetContexts interface {
	Contexts() *context.ContextTree
}

type IHostHelper

type IHostHelper interface {
	GetPullRequestURL(from string, to string) (string, error)
	GetCommitURL(commitSha string) (string, error)
}

type IPatchBuildingHelper

type IPatchBuildingHelper interface {
	ValidateNormalWorkingTreeState() (bool, error)
}

type IRefsHelper

type IRefsHelper interface {
	CheckoutRef(ref string, options types.CheckoutRefOptions) error
	GetCheckedOutRef() *models.Branch
	CreateGitResetMenu(ref string) error
	ResetToRef(ref string, strength string, envVars []string) error
	NewBranch(from string, fromDescription string, suggestedBranchname string) error
}

type ISuggestionsHelper

type ISuggestionsHelper interface {
	GetRemoteSuggestionsFunc() func(string) []*types.Suggestion
	GetBranchNameSuggestionsFunc() func(string) []*types.Suggestion
	GetFilePathSuggestionsFunc() func(string) []*types.Suggestion
	GetRemoteBranchesSuggestionsFunc(separator string) func(string) []*types.Suggestion
	GetRefsSuggestionsFunc() func(string) []*types.Suggestion
}

type IUpstreamHelper

type IUpstreamHelper interface {
	ParseUpstream(string) (string, string, error)
	PromptForUpstreamWithInitialContent(*models.Branch, func(string) error) error
	PromptForUpstreamWithoutInitialContent(*models.Branch, func(string) error) error
	GetSuggestedRemote() string
}

type IWorkingTreeHelper

type IWorkingTreeHelper interface {
	AnyStagedFiles() bool
	AnyTrackedFiles() bool
	IsWorkingTreeDirty() bool
	FileForSubmodule(submodule *models.SubmoduleConfig) *models.File
}

type IWorktreeHelper

type IWorktreeHelper interface {
	GetMainWorktreeName() string
	GetCurrentWorktreeName() string
}

type InlineStatusHelper

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

func NewInlineStatusHelper

func NewInlineStatusHelper(c *HelperCommon, windowHelper *WindowHelper) *InlineStatusHelper

func (*InlineStatusHelper) WithInlineStatus

func (self *InlineStatusHelper) WithInlineStatus(opts InlineStatusOpts, f func(gocui.Task) error)

type InlineStatusOpts

type InlineStatusOpts struct {
	Item       types.HasUrn
	Operation  types.ItemOperation
	ContextKey types.ContextKey
}

type MergeAndRebaseHelper

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

func NewMergeAndRebaseHelper

func NewMergeAndRebaseHelper(
	c *HelperCommon,
	refsHelper *RefsHelper,
) *MergeAndRebaseHelper

func (*MergeAndRebaseHelper) AbortMergeOrRebaseWithConfirm

func (self *MergeAndRebaseHelper) AbortMergeOrRebaseWithConfirm() error

func (*MergeAndRebaseHelper) CheckForConflicts

func (self *MergeAndRebaseHelper) CheckForConflicts(result error) error

func (*MergeAndRebaseHelper) CheckMergeOrRebase

func (self *MergeAndRebaseHelper) CheckMergeOrRebase(result error) error

func (*MergeAndRebaseHelper) CheckMergeOrRebaseWithRefreshOptions

func (self *MergeAndRebaseHelper) CheckMergeOrRebaseWithRefreshOptions(result error, refreshOptions types.RefreshOptions) error

func (*MergeAndRebaseHelper) CreateRebaseOptionsMenu

func (self *MergeAndRebaseHelper) CreateRebaseOptionsMenu() error

func (*MergeAndRebaseHelper) MergeRefIntoCheckedOutBranch

func (self *MergeAndRebaseHelper) MergeRefIntoCheckedOutBranch(refName string) error

func (*MergeAndRebaseHelper) PromptForConflictHandling

func (self *MergeAndRebaseHelper) PromptForConflictHandling() error

func (*MergeAndRebaseHelper) PromptToContinueRebase

func (self *MergeAndRebaseHelper) PromptToContinueRebase() error

PromptToContinueRebase asks the user if they want to continue the rebase/merge that's in progress

func (*MergeAndRebaseHelper) RebaseOntoRef

func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error

func (*MergeAndRebaseHelper) ResetMarkedBaseCommit

func (self *MergeAndRebaseHelper) ResetMarkedBaseCommit() error

type MergeConflictsHelper

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

func NewMergeConflictsHelper

func NewMergeConflictsHelper(
	c *HelperCommon,
) *MergeConflictsHelper

func (*MergeConflictsHelper) EscapeMerge

func (self *MergeConflictsHelper) EscapeMerge() error

func (*MergeConflictsHelper) RefreshMergeState

func (self *MergeConflictsHelper) RefreshMergeState() error

func (*MergeConflictsHelper) Render

func (self *MergeConflictsHelper) Render() error

func (*MergeConflictsHelper) ResetMergeState

func (self *MergeConflictsHelper) ResetMergeState()

func (*MergeConflictsHelper) SetConflictsAndRender

func (self *MergeConflictsHelper) SetConflictsAndRender(path string) (bool, error)

func (*MergeConflictsHelper) SetMergeState

func (self *MergeConflictsHelper) SetMergeState(path string) (bool, error)

func (*MergeConflictsHelper) SwitchToMerge

func (self *MergeConflictsHelper) SwitchToMerge(path string) error

type ModeHelper

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

func NewModeHelper

func NewModeHelper(
	c *HelperCommon,
	diffHelper *DiffHelper,
	patchBuildingHelper *PatchBuildingHelper,
	cherryPickHelper *CherryPickHelper,
	mergeAndRebaseHelper *MergeAndRebaseHelper,
	bisectHelper *BisectHelper,
) *ModeHelper

func (*ModeHelper) ClearFiltering

func (self *ModeHelper) ClearFiltering() error

func (*ModeHelper) ExitFilterMode

func (self *ModeHelper) ExitFilterMode() error

func (*ModeHelper) GetActiveMode

func (self *ModeHelper) GetActiveMode() (ModeStatus, bool)

func (*ModeHelper) IsAnyModeActive

func (self *ModeHelper) IsAnyModeActive() bool

func (*ModeHelper) SetSuppressRebasingMode

func (self *ModeHelper) SetSuppressRebasingMode(value bool)

func (*ModeHelper) Statuses

func (self *ModeHelper) Statuses() []ModeStatus

type ModeStatus

type ModeStatus struct {
	IsActive    func() bool
	Description func() string
	Reset       func() error
}

type OpenCommitMessagePanelOpts

type OpenCommitMessagePanelOpts struct {
	CommitIndex      int
	SummaryTitle     string
	DescriptionTitle string
	PreserveMessage  bool
	OnConfirm        func(summary string, description string) error
	OnSwitchToEditor func(string) error
	InitialMessage   string
}

type PatchBuildingHelper

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

func NewPatchBuildingHelper

func NewPatchBuildingHelper(
	c *HelperCommon,
) *PatchBuildingHelper

func (*PatchBuildingHelper) Escape

func (self *PatchBuildingHelper) Escape() error

takes us from the patch building panel back to the commit files panel

func (*PatchBuildingHelper) RefreshPatchBuildingPanel

func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpts) error

func (*PatchBuildingHelper) Reset

func (self *PatchBuildingHelper) Reset() error

kills the custom patch and returns us back to the commit files panel if needed

func (*PatchBuildingHelper) ValidateNormalWorkingTreeState

func (self *PatchBuildingHelper) ValidateNormalWorkingTreeState() (bool, error)

type RebaseOption

type RebaseOption string

type RecordDirectoryHelper

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

func NewRecordDirectoryHelper

func NewRecordDirectoryHelper(c *HelperCommon) *RecordDirectoryHelper

func (*RecordDirectoryHelper) RecordCurrentDirectory

func (self *RecordDirectoryHelper) RecordCurrentDirectory() error

when a user runs lazygit with the LAZYGIT_NEW_DIR_FILE env variable defined we will write the current directory to that file on exit so that their shell can then change to that directory. That means you don't get kicked back to the directory that you started with.

func (*RecordDirectoryHelper) RecordDirectory

func (self *RecordDirectoryHelper) RecordDirectory(dirName string) error

type RefreshHelper

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

func NewRefreshHelper

func NewRefreshHelper(
	c *HelperCommon,
	refsHelper *RefsHelper,
	mergeAndRebaseHelper *MergeAndRebaseHelper,
	patchBuildingHelper *PatchBuildingHelper,
	stagingHelper *StagingHelper,
	mergeConflictsHelper *MergeConflictsHelper,
	worktreeHelper *WorktreeHelper,
	searchHelper *SearchHelper,
) *RefreshHelper

func (*RefreshHelper) Refresh

func (self *RefreshHelper) Refresh(options types.RefreshOptions) error

func (*RefreshHelper) RefreshAuthors

func (self *RefreshHelper) RefreshAuthors(commits []*models.Commit)

type RefsHelper

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

func NewRefsHelper

func NewRefsHelper(
	c *HelperCommon,
) *RefsHelper

func (*RefsHelper) CheckoutRef

func (self *RefsHelper) CheckoutRef(ref string, options types.CheckoutRefOptions) error

func (*RefsHelper) CreateGitResetMenu

func (self *RefsHelper) CreateGitResetMenu(ref string) error

func (*RefsHelper) CreateSortOrderMenu

func (self *RefsHelper) CreateSortOrderMenu(sortOptionsOrder []string, onSelected func(sortOrder string) error) error

func (*RefsHelper) GetCheckedOutRef

func (self *RefsHelper) GetCheckedOutRef() *models.Branch

func (*RefsHelper) NewBranch

func (self *RefsHelper) NewBranch(from string, fromFormattedName string, suggestedBranchName string) error

func (*RefsHelper) ResetToRef

func (self *RefsHelper) ResetToRef(ref string, strength string, envVars []string) error

type ReposHelper

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

helps switch back and forth between repos

func NewRecentReposHelper

func NewRecentReposHelper(
	c *HelperCommon,
	recordDirectoryHelper *RecordDirectoryHelper,
	onNewRepo onNewRepoFn,
) *ReposHelper

func (*ReposHelper) CreateRecentReposMenu

func (self *ReposHelper) CreateRecentReposMenu() error

func (*ReposHelper) DispatchSwitchTo

func (self *ReposHelper) DispatchSwitchTo(path string, errMsg string, contextKey types.ContextKey) error

func (*ReposHelper) DispatchSwitchToRepo

func (self *ReposHelper) DispatchSwitchToRepo(path string, contextKey types.ContextKey) error

func (*ReposHelper) EnterSubmodule

func (self *ReposHelper) EnterSubmodule(submodule *models.SubmoduleConfig) error

type SearchHelper

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

func NewSearchHelper

func NewSearchHelper(
	c *HelperCommon,
) *SearchHelper

func (*SearchHelper) Cancel

func (self *SearchHelper) Cancel()

func (*SearchHelper) CancelPrompt

func (self *SearchHelper) CancelPrompt() error

func (*SearchHelper) CancelSearchIfSearching

func (self *SearchHelper) CancelSearchIfSearching(c types.Context)

func (*SearchHelper) Confirm

func (self *SearchHelper) Confirm() error

func (*SearchHelper) ConfirmFilter

func (self *SearchHelper) ConfirmFilter() error

func (*SearchHelper) ConfirmSearch

func (self *SearchHelper) ConfirmSearch() error

func (*SearchHelper) DisplayFilterStatus

func (self *SearchHelper) DisplayFilterStatus(context types.IFilterableContext)

func (*SearchHelper) DisplaySearchStatus

func (self *SearchHelper) DisplaySearchStatus(context types.ISearchableContext)

func (*SearchHelper) HidePrompt

func (self *SearchHelper) HidePrompt()

func (*SearchHelper) OnPromptContentChanged

func (self *SearchHelper) OnPromptContentChanged(searchString string)

func (*SearchHelper) OpenFilterPrompt

func (self *SearchHelper) OpenFilterPrompt(context types.IFilterableContext) error

func (*SearchHelper) OpenSearchPrompt

func (self *SearchHelper) OpenSearchPrompt(context types.ISearchableContext) error

func (*SearchHelper) ReApplyFilter

func (self *SearchHelper) ReApplyFilter(context types.Context)

func (*SearchHelper) RenderSearchStatus

func (self *SearchHelper) RenderSearchStatus(c types.Context)

func (*SearchHelper) ScrollHistory

func (self *SearchHelper) ScrollHistory(scrollIncrement int)

type SnakeHelper

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

func NewSnakeHelper

func NewSnakeHelper(c *HelperCommon) *SnakeHelper

func (*SnakeHelper) ExitGame

func (self *SnakeHelper) ExitGame()

func (*SnakeHelper) SetDirection

func (self *SnakeHelper) SetDirection(direction snake.Direction)

func (*SnakeHelper) StartGame

func (self *SnakeHelper) StartGame()

type StagingHelper

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

func NewStagingHelper

func NewStagingHelper(
	c *HelperCommon,
) *StagingHelper

func (*StagingHelper) RefreshStagingPanel

func (self *StagingHelper) RefreshStagingPanel(focusOpts types.OnFocusOpts) error

NOTE: used from outside this file

type SubCommitsHelper

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

func NewSubCommitsHelper

func NewSubCommitsHelper(
	c *HelperCommon,
	refreshHelper *RefreshHelper,
	setSubCommits func([]*models.Commit),
) *SubCommitsHelper

func (*SubCommitsHelper) ViewSubCommits

func (self *SubCommitsHelper) ViewSubCommits(opts ViewSubCommitsOpts) error

type SuggestionsHelper

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

func NewSuggestionsHelper

func NewSuggestionsHelper(
	c *HelperCommon,
) *SuggestionsHelper

func (*SuggestionsHelper) GetAuthorsSuggestionsFunc

func (self *SuggestionsHelper) GetAuthorsSuggestionsFunc() func(string) []*types.Suggestion

func (*SuggestionsHelper) GetBranchNameSuggestionsFunc

func (self *SuggestionsHelper) GetBranchNameSuggestionsFunc() func(string) []*types.Suggestion

func (*SuggestionsHelper) GetFilePathSuggestionsFunc

func (self *SuggestionsHelper) GetFilePathSuggestionsFunc() func(string) []*types.Suggestion

here we asynchronously fetch the latest set of paths in the repo and store in self.c.Model().FilesTrie. On the main thread we'll be doing a fuzzy search via self.c.Model().FilesTrie. So if we've looked for a file previously, we'll start with the old trie and eventually it'll be swapped out for the new one. Notably, unlike other suggestion functions we're not showing all the options if nothing has been typed because there'll be too much to display efficiently

func (*SuggestionsHelper) GetRefsSuggestionsFunc

func (self *SuggestionsHelper) GetRefsSuggestionsFunc() func(string) []*types.Suggestion

func (*SuggestionsHelper) GetRemoteBranchesSuggestionsFunc

func (self *SuggestionsHelper) GetRemoteBranchesSuggestionsFunc(separator string) func(string) []*types.Suggestion

func (*SuggestionsHelper) GetRemoteSuggestionsFunc

func (self *SuggestionsHelper) GetRemoteSuggestionsFunc() func(string) []*types.Suggestion

func (*SuggestionsHelper) GetTagsSuggestionsFunc

func (self *SuggestionsHelper) GetTagsSuggestionsFunc() func(string) []*types.Suggestion

type TagsHelper

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

func NewTagsHelper

func NewTagsHelper(c *HelperCommon, commitsHelper *CommitsHelper) *TagsHelper

func (*TagsHelper) OpenCreateTagPrompt

func (self *TagsHelper) OpenCreateTagPrompt(ref string, onCreate func()) error

type UpdateHelper

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

func NewUpdateHelper

func NewUpdateHelper(c *HelperCommon, updater *updates.Updater) *UpdateHelper

func (*UpdateHelper) CheckForUpdateInBackground

func (self *UpdateHelper) CheckForUpdateInBackground()

func (*UpdateHelper) CheckForUpdateInForeground

func (self *UpdateHelper) CheckForUpdateInForeground() error

type UpstreamHelper

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

func NewUpstreamHelper

func NewUpstreamHelper(
	c *HelperCommon,
	getRemoteBranchesSuggestionsFunc func(string) func(string) []*types.Suggestion,
) *UpstreamHelper

func (*UpstreamHelper) GetSuggestedRemote

func (self *UpstreamHelper) GetSuggestedRemote() string

func (*UpstreamHelper) ParseUpstream

func (self *UpstreamHelper) ParseUpstream(upstream string) (string, string, error)

func (*UpstreamHelper) PromptForUpstreamWithInitialContent

func (self *UpstreamHelper) PromptForUpstreamWithInitialContent(currentBranch *models.Branch, onConfirm func(string) error) error

func (*UpstreamHelper) PromptForUpstreamWithoutInitialContent

func (self *UpstreamHelper) PromptForUpstreamWithoutInitialContent(_ *models.Branch, onConfirm func(string) error) error

type ViewHelper

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

func NewViewHelper

func NewViewHelper(c *HelperCommon, contexts *context.ContextTree) *ViewHelper

func (*ViewHelper) ContextForView

func (self *ViewHelper) ContextForView(viewName string) (types.Context, bool)

type ViewSubCommitsOpts

type ViewSubCommitsOpts struct {
	Ref                     types.Ref
	RefToShowDivergenceFrom string
	TitleRef                string
	Context                 types.Context
	ShowBranchHeads         bool
}

type WindowArrangementArgs

type WindowArrangementArgs struct {
	// Width of the screen (in characters)
	Width int
	// Height of the screen (in characters)
	Height int
	// User config
	UserConfig *config.UserConfig
	// Name of the currently focused window
	CurrentWindow string
	// Name of the current static window (meaning popups are ignored)
	CurrentStaticWindow string
	// Name of the current side window (i.e. the current window in the left
	// section of the UI)
	CurrentSideWindow string
	// Whether the main panel is split (as is the case e.g. when a file has both
	// staged and unstaged changes)
	SplitMainPanel bool
	// The current screen mode (normal, half, full)
	ScreenMode types.WindowMaximisation
	// The content shown on the bottom left of the screen when showing a loader
	// or toast e.g. 'Rebasing /'
	AppStatus string
	// The content shown on the bottom right of the screen (e.g. the 'donate',
	// 'ask question' links or a message about the current mode e.g. rebase mode)
	InformationStr string
	// Whether to show the extras window which contains the command log context
	ShowExtrasWindow bool
	// Whether we are in a demo (which is used for generating demo gifs for the
	// repo's readme)
	InDemo bool
	// Whether any mode is active (e.g. rebasing, cherry picking, etc)
	IsAnyModeActive bool
	// Whether the search prompt is shown in the bottom left
	InSearchPrompt bool
	// One of ” (not searching), 'Search: ', and 'Filter: '
	SearchPrefix string
}

type WindowArrangementHelper

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

func NewWindowArrangementHelper

func NewWindowArrangementHelper(
	c *HelperCommon,
	windowHelper *WindowHelper,
	modeHelper *ModeHelper,
	appStatusHelper *AppStatusHelper,
) *WindowArrangementHelper

func (*WindowArrangementHelper) GetWindowDimensions

func (self *WindowArrangementHelper) GetWindowDimensions(informationStr string, appStatus string) map[string]boxlayout.Dimensions

type WindowHelper

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

func NewWindowHelper

func NewWindowHelper(c *HelperCommon, viewHelper *ViewHelper) *WindowHelper

func (*WindowHelper) CurrentWindow

func (self *WindowHelper) CurrentWindow() string

func (*WindowHelper) GetContextForWindow

func (self *WindowHelper) GetContextForWindow(window string) types.Context

func (*WindowHelper) GetViewNameForWindow

func (self *WindowHelper) GetViewNameForWindow(window string) string

func (*WindowHelper) MoveToTopOfWindow

func (self *WindowHelper) MoveToTopOfWindow(context types.Context)

moves given context's view to the top of the window

func (*WindowHelper) SetWindowContext

func (self *WindowHelper) SetWindowContext(c types.Context)

for now all we actually care about is the context's view so we're storing that

func (*WindowHelper) SideWindows

func (self *WindowHelper) SideWindows() []string

func (*WindowHelper) TopViewInWindow

func (self *WindowHelper) TopViewInWindow(windowName string, includeInvisibleViews bool) *gocui.View

func (*WindowHelper) WindowForView

func (self *WindowHelper) WindowForView(viewName string) string

type WorkingTreeHelper

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

func NewWorkingTreeHelper

func NewWorkingTreeHelper(
	c *HelperCommon,
	refHelper *RefsHelper,
	commitsHelper *CommitsHelper,
	gpgHelper *GpgHelper,
) *WorkingTreeHelper

func (*WorkingTreeHelper) AnyStagedFiles

func (self *WorkingTreeHelper) AnyStagedFiles() bool

func (*WorkingTreeHelper) AnyTrackedFiles

func (self *WorkingTreeHelper) AnyTrackedFiles() bool

func (*WorkingTreeHelper) FileForSubmodule

func (self *WorkingTreeHelper) FileForSubmodule(submodule *models.SubmoduleConfig) *models.File

func (*WorkingTreeHelper) HandleCommitEditorPress

func (self *WorkingTreeHelper) HandleCommitEditorPress() error

HandleCommitEditorPress - handle when the user wants to commit changes via their editor rather than via the popup panel

func (*WorkingTreeHelper) HandleCommitPress

func (self *WorkingTreeHelper) HandleCommitPress() error

func (*WorkingTreeHelper) HandleCommitPressWithMessage

func (self *WorkingTreeHelper) HandleCommitPressWithMessage(initialMessage string) error

func (*WorkingTreeHelper) HandleWIPCommitPress

func (self *WorkingTreeHelper) HandleWIPCommitPress() error

func (*WorkingTreeHelper) IsWorkingTreeDirty

func (self *WorkingTreeHelper) IsWorkingTreeDirty() bool

func (*WorkingTreeHelper) OpenMergeTool

func (self *WorkingTreeHelper) OpenMergeTool() error

func (*WorkingTreeHelper) WithEnsureCommitableFiles

func (self *WorkingTreeHelper) WithEnsureCommitableFiles(handler func() error) error

type WorktreeHelper

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

func NewWorktreeHelper

func NewWorktreeHelper(c *HelperCommon, reposHelper *ReposHelper, refsHelper *RefsHelper, suggestionsHelper *SuggestionsHelper) *WorktreeHelper

func (*WorktreeHelper) Detach

func (self *WorktreeHelper) Detach(worktree *models.Worktree) error

func (*WorktreeHelper) GetLinkedWorktreeName

func (self *WorktreeHelper) GetLinkedWorktreeName() string

If we're on the main worktree, we return an empty string

func (*WorktreeHelper) GetMainWorktreeName

func (self *WorktreeHelper) GetMainWorktreeName() string

func (*WorktreeHelper) NewWorktree

func (self *WorktreeHelper) NewWorktree() error

func (*WorktreeHelper) NewWorktreeCheckout

func (self *WorktreeHelper) NewWorktreeCheckout(base string, canCheckoutBase bool, detached bool, contextKey types.ContextKey) error

func (*WorktreeHelper) Remove

func (self *WorktreeHelper) Remove(worktree *models.Worktree, force bool) error

func (*WorktreeHelper) Switch

func (self *WorktreeHelper) Switch(worktree *models.Worktree, contextKey types.ContextKey) error

func (*WorktreeHelper) ViewBranchWorktreeOptions

func (self *WorktreeHelper) ViewBranchWorktreeOptions(branchName string, canCheckoutBase bool) error

func (*WorktreeHelper) ViewWorktreeOptions

func (self *WorktreeHelper) ViewWorktreeOptions(context types.IListContext, ref string) error

Jump to

Keyboard shortcuts

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