Documentation ¶
Index ¶
- Constants
- Variables
- func GetKeyDisplay(key interface{}) string
- func NewFileWatcher(log *logrus.Entry) *fileWatcher
- type Binding
- type Gui
- func (gui *Gui) GenerateSentinelErrors()
- func (gui *Gui) GetInitialKeybindings() []*Binding
- func (gui *Gui) HandleCredentialsPopup(g *gocui.Gui, popupOpened bool, cmdErr error)
- func (gui *Gui) HandlePasteCommits(g *gocui.Gui, v *gocui.View) error
- func (gui *Gui) PrepareSubProcess(g *gocui.Gui, commands ...string)
- func (gui *Gui) RenderCommitLength()
- func (gui *Gui) RenderSelectedBranchUpstreamDifferences() error
- func (gui *Gui) Run() error
- func (gui *Gui) RunWithSubprocesses() error
- func (gui *Gui) WithWaitingStatus(name string, f func() error) error
- type SentinelErrors
- type Teml
Constants ¶
const ( SCREEN_NORMAL int = iota SCREEN_HALF SCREEN_FULL )
const ( LINE = iota RANGE HUNK )
these represent what select mode we're in
const MAX_WATCHED_FILES = 50
macs for some bizarre reason cap the number of watchable files to 256. there's no obvious platform agonstic way to check the situation of the user's computer so we're just arbitrarily capping at 200. This isn't so bad because file watching is only really an added bonus for faster refreshing.
const StartupPopupVersion = 1
Variables ¶
var OverlappingEdges = false
OverlappingEdges determines if panel edges overlap
Functions ¶
func GetKeyDisplay ¶ added in v0.12.1
func GetKeyDisplay(key interface{}) string
func NewFileWatcher ¶ added in v0.12.1
Types ¶
type Binding ¶
type Binding struct { ViewName string Contexts []string Handler func(*gocui.Gui, *gocui.View) error Key interface{} // FIXME: find out how to get `gocui.Key | rune` Modifier gocui.Modifier Description string Alternative string }
Binding - a keybinding mapping a key and modifier to a handler. The keypress is only handled if the given view has focus, or handled globally if the view is ""
func (*Binding) GetDisplayStrings ¶ added in v0.3.0
GetDisplayStrings returns the display string of a file
type Gui ¶
type Gui struct { Log *logrus.Entry GitCommand *commands.GitCommand OSCommand *commands.OSCommand SubProcess *exec.Cmd State guiState Config config.AppConfigurer Tr *i18n.Localizer Errors SentinelErrors Updater *updates.Updater // contains filtered or unexported fields }
Gui wraps the gocui Gui object which handles rendering and events
func NewGui ¶
func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *commands.OSCommand, tr *i18n.Localizer, config config.AppConfigurer, updater *updates.Updater) (*Gui, error)
NewGui builds a new gui handler
func (*Gui) GenerateSentinelErrors ¶ added in v0.1.62
func (gui *Gui) GenerateSentinelErrors()
GenerateSentinelErrors makes the sentinel errors for the gui. We're defining it here because we can't do package-scoped errors with localization, and also because it seems like package-scoped variables are bad in general https://dave.cheney.net/2017/06/11/go-without-package-scoped-variables In the future it would be good to implement some of the recommendations of that article. For now, if we don't need an error to be a sentinel, we will just define it inline. This has implications for error messages that pop up everywhere in that we'll be duplicating the default values. We may need to look at having a default localisation bundle defined, and just using keys-only when localising things in the code.
func (*Gui) GetInitialKeybindings ¶ added in v0.7.1
GetInitialKeybindings is a function.
func (*Gui) HandleCredentialsPopup ¶ added in v0.7.1
HandleCredentialsPopup handles the views after executing a command that might ask for credentials
func (*Gui) HandlePasteCommits ¶ added in v0.7.1
HandlePasteCommits begins a cherry-pick rebase with the commits the user has copied
func (*Gui) PrepareSubProcess ¶
PrepareSubProcess - prepare a subprocess for execution and tell the gui to switch to it
func (*Gui) RenderCommitLength ¶ added in v0.2.2
func (gui *Gui) RenderCommitLength()
RenderCommitLength is a function.
func (*Gui) RenderSelectedBranchUpstreamDifferences ¶ added in v0.7.1
func (*Gui) RunWithSubprocesses ¶
RunWithSubprocesses loops, instantiating a new gocui.Gui with each iteration if the error returned from a run is a ErrSubProcess, it runs the subprocess otherwise it handles the error, possibly by quitting the application
type SentinelErrors ¶ added in v0.1.62
SentinelErrors are the errors that have special meaning and need to be checked by calling functions. The less of these, the better
Source Files ¶
- app_status_manager.go
- branches_panel.go
- commit_files_panel.go
- commit_message_panel.go
- commits_panel.go
- confirmation_panel.go
- context.go
- credentials_panel.go
- discard_changes_menu_panel.go
- file_watching.go
- files_panel.go
- git_flow.go
- gui.go
- keybindings.go
- line_by_line_panel.go
- list_view.go
- menu_panel.go
- merge_panel.go
- options_menu_panel.go
- patch_building_panel.go
- patch_options_panel.go
- pty.go
- quitting.go
- rebase_options_panel.go
- recent_repos_panel.go
- reflog_panel.go
- remote_branches_panel.go
- remotes_panel.go
- reset_menu_panel.go
- searching.go
- staging_panel.go
- stash_panel.go
- status_panel.go
- tags_panel.go
- tasks_adapter.go
- updates.go
- view_helpers.go
- workspace_reset_options_panel.go