2018-08-12 19:31:27 +10:00
package gui
2018-08-08 19:18:41 +10:00
2018-09-17 21:02:30 +10:00
import (
2020-09-23 19:49:41 +10:00
"fmt"
2019-12-04 19:16:47 -08:00
"log"
2019-12-04 18:01:01 -08:00
"strings"
2020-01-07 21:42:33 +11:00
2020-08-12 19:19:32 +10:00
"unicode/utf8"
2020-01-07 21:42:33 +11:00
"github.com/jesseduffield/gocui"
2018-09-17 21:02:30 +10:00
)
2018-08-08 19:18:41 +10:00
// 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 ""
type Binding struct {
2018-08-29 11:56:28 +02:00
ViewName string
2019-11-16 12:41:04 +11:00
Contexts [ ] string
2018-08-29 11:56:28 +02:00
Handler func ( * gocui . Gui , * gocui . View ) error
Key interface { } // FIXME: find out how to get `gocui.Key | rune`
Modifier gocui . Modifier
2018-08-28 20:13:01 +02:00
Description string
2019-05-03 10:33:25 +05:30
Alternative string
2020-10-02 07:32:48 +10:00
Tag string // e.g. 'navigation'. Used for grouping things in the cheatsheet
2018-08-08 19:18:41 +10:00
}
2018-09-17 21:02:30 +10:00
// GetDisplayStrings returns the display string of a file
2019-02-16 15:17:44 +11:00
func ( b * Binding ) GetDisplayStrings ( isFocused bool ) [ ] string {
2020-01-07 09:50:25 -08:00
return [ ] string { GetKeyDisplay ( b . Key ) , b . Description }
2018-09-17 21:02:30 +10:00
}
2020-01-06 23:37:33 +08:00
var keyMapReversed = map [ gocui . Key ] string {
gocui . KeyF1 : "f1" ,
gocui . KeyF2 : "f2" ,
gocui . KeyF3 : "f3" ,
gocui . KeyF4 : "f4" ,
gocui . KeyF5 : "f5" ,
gocui . KeyF6 : "f6" ,
gocui . KeyF7 : "f7" ,
gocui . KeyF8 : "f8" ,
gocui . KeyF9 : "f9" ,
gocui . KeyF10 : "f10" ,
gocui . KeyF11 : "f11" ,
gocui . KeyF12 : "f12" ,
gocui . KeyInsert : "insert" ,
gocui . KeyDelete : "delete" ,
gocui . KeyHome : "home" ,
gocui . KeyEnd : "end" ,
gocui . KeyPgup : "pgup" ,
gocui . KeyPgdn : "pgdown" ,
2020-01-07 09:50:25 -08:00
gocui . KeyArrowUp : "▲" ,
gocui . KeyArrowDown : "▼" ,
gocui . KeyArrowLeft : "◄" ,
gocui . KeyArrowRight : "►" ,
2020-01-06 23:37:33 +08:00
gocui . KeyTab : "tab" , // ctrl+i
gocui . KeyEnter : "enter" , // ctrl+m
gocui . KeyEsc : "esc" , // ctrl+[, ctrl+3
gocui . KeyBackspace : "backspace" , // ctrl+h
gocui . KeyCtrlSpace : "ctrl+space" , // ctrl+~, ctrl+2
2020-01-07 08:38:07 +08:00
gocui . KeyCtrlSlash : "ctrl+/" , // ctrl+_
2020-01-06 23:37:33 +08:00
gocui . KeySpace : "space" ,
gocui . KeyCtrlA : "ctrl+a" ,
gocui . KeyCtrlB : "ctrl+b" ,
gocui . KeyCtrlC : "ctrl+c" ,
gocui . KeyCtrlD : "ctrl+d" ,
gocui . KeyCtrlE : "ctrl+e" ,
gocui . KeyCtrlF : "ctrl+f" ,
gocui . KeyCtrlG : "ctrl+g" ,
gocui . KeyCtrlJ : "ctrl+j" ,
gocui . KeyCtrlK : "ctrl+k" ,
gocui . KeyCtrlL : "ctrl+l" ,
gocui . KeyCtrlN : "ctrl+n" ,
gocui . KeyCtrlO : "ctrl+o" ,
gocui . KeyCtrlP : "ctrl+p" ,
gocui . KeyCtrlQ : "ctrl+q" ,
gocui . KeyCtrlR : "ctrl+r" ,
gocui . KeyCtrlS : "ctrl+s" ,
gocui . KeyCtrlT : "ctrl+t" ,
gocui . KeyCtrlU : "ctrl+u" ,
gocui . KeyCtrlV : "ctrl+v" ,
gocui . KeyCtrlW : "ctrl+w" ,
gocui . KeyCtrlX : "ctrl+x" ,
gocui . KeyCtrlY : "ctrl+y" ,
gocui . KeyCtrlZ : "ctrl+z" ,
2020-01-07 08:38:07 +08:00
gocui . KeyCtrl4 : "ctrl+4" , // ctrl+\
gocui . KeyCtrl5 : "ctrl+5" , // ctrl+]
2020-01-06 23:37:33 +08:00
gocui . KeyCtrl6 : "ctrl+6" ,
gocui . KeyCtrl8 : "ctrl+8" ,
}
2019-12-04 18:01:01 -08:00
var keymap = map [ string ] interface { } {
"<c-a>" : gocui . KeyCtrlA ,
"<c-b>" : gocui . KeyCtrlB ,
"<c-c>" : gocui . KeyCtrlC ,
"<c-d>" : gocui . KeyCtrlD ,
"<c-e>" : gocui . KeyCtrlE ,
"<c-f>" : gocui . KeyCtrlF ,
"<c-g>" : gocui . KeyCtrlG ,
"<c-h>" : gocui . KeyCtrlH ,
"<c-i>" : gocui . KeyCtrlI ,
"<c-j>" : gocui . KeyCtrlJ ,
"<c-k>" : gocui . KeyCtrlK ,
"<c-l>" : gocui . KeyCtrlL ,
"<c-m>" : gocui . KeyCtrlM ,
"<c-n>" : gocui . KeyCtrlN ,
"<c-o>" : gocui . KeyCtrlO ,
"<c-p>" : gocui . KeyCtrlP ,
"<c-q>" : gocui . KeyCtrlQ ,
"<c-r>" : gocui . KeyCtrlR ,
"<c-s>" : gocui . KeyCtrlS ,
"<c-t>" : gocui . KeyCtrlT ,
"<c-u>" : gocui . KeyCtrlU ,
"<c-v>" : gocui . KeyCtrlV ,
"<c-w>" : gocui . KeyCtrlW ,
"<c-x>" : gocui . KeyCtrlX ,
"<c-y>" : gocui . KeyCtrlY ,
"<c-z>" : gocui . KeyCtrlZ ,
"<c-~>" : gocui . KeyCtrlTilde ,
"<c-2>" : gocui . KeyCtrl2 ,
"<c-3>" : gocui . KeyCtrl3 ,
"<c-4>" : gocui . KeyCtrl4 ,
"<c-5>" : gocui . KeyCtrl5 ,
"<c-6>" : gocui . KeyCtrl6 ,
"<c-7>" : gocui . KeyCtrl7 ,
"<c-8>" : gocui . KeyCtrl8 ,
"<c-space>" : gocui . KeyCtrlSpace ,
"<c-\\>" : gocui . KeyCtrlBackslash ,
"<c-[>" : gocui . KeyCtrlLsqBracket ,
"<c-]>" : gocui . KeyCtrlRsqBracket ,
"<c-/>" : gocui . KeyCtrlSlash ,
"<c-_>" : gocui . KeyCtrlUnderscore ,
"<backspace>" : gocui . KeyBackspace ,
"<tab>" : gocui . KeyTab ,
"<enter>" : gocui . KeyEnter ,
"<esc>" : gocui . KeyEsc ,
"<space>" : gocui . KeySpace ,
"<f1>" : gocui . KeyF1 ,
"<f2>" : gocui . KeyF2 ,
"<f3>" : gocui . KeyF3 ,
"<f4>" : gocui . KeyF4 ,
"<f5>" : gocui . KeyF5 ,
"<f6>" : gocui . KeyF6 ,
"<f7>" : gocui . KeyF7 ,
"<f8>" : gocui . KeyF8 ,
"<f9>" : gocui . KeyF9 ,
"<f10>" : gocui . KeyF10 ,
"<f11>" : gocui . KeyF11 ,
"<f12>" : gocui . KeyF12 ,
"<insert>" : gocui . KeyInsert ,
"<delete>" : gocui . KeyDelete ,
"<home>" : gocui . KeyHome ,
"<end>" : gocui . KeyEnd ,
"<pgup>" : gocui . KeyPgup ,
"<pgdown>" : gocui . KeyPgdn ,
"<up>" : gocui . KeyArrowUp ,
"<down>" : gocui . KeyArrowDown ,
"<left>" : gocui . KeyArrowLeft ,
"<right>" : gocui . KeyArrowRight ,
}
2020-01-07 09:50:25 -08:00
func ( gui * Gui ) getKeyDisplay ( name string ) string {
key := gui . getKey ( name )
return GetKeyDisplay ( key )
}
func GetKeyDisplay ( key interface { } ) string {
keyInt := 0
2020-03-09 11:34:10 +11:00
switch key := key . ( type ) {
2020-01-07 09:50:25 -08:00
case rune :
2020-03-09 11:34:10 +11:00
keyInt = int ( key )
2020-01-07 09:50:25 -08:00
case gocui . Key :
2020-03-09 11:34:10 +11:00
value , ok := keyMapReversed [ key ]
2020-01-07 09:50:25 -08:00
if ok {
return value
}
2020-03-09 11:34:10 +11:00
keyInt = int ( key )
2020-01-07 09:50:25 -08:00
}
2020-09-23 19:49:41 +10:00
return fmt . Sprintf ( "%c" , keyInt )
2020-01-07 09:50:25 -08:00
}
2020-10-03 14:54:55 +10:00
func ( gui * Gui ) getKey ( key string ) interface { } {
2020-08-12 19:19:32 +10:00
runeCount := utf8 . RuneCountInString ( key )
if runeCount > 1 {
2019-12-04 19:16:47 -08:00
binding := keymap [ strings . ToLower ( key ) ]
if binding == nil {
2020-10-03 14:54:55 +10:00
log . Fatalf ( "Unrecognized key %s for keybinding. For permitted values see https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md" , strings . ToLower ( key ) )
2019-12-04 19:16:47 -08:00
} else {
return binding
}
2020-08-12 19:19:32 +10:00
} else if runeCount == 1 {
2019-12-04 18:01:01 -08:00
return [ ] rune ( key ) [ 0 ]
}
2020-10-03 14:54:55 +10:00
log . Fatal ( "Key empty for keybinding: " + strings . ToLower ( key ) )
2019-12-04 18:01:01 -08:00
return nil
}
2019-02-16 12:07:27 +11:00
// GetInitialKeybindings is a function.
func ( gui * Gui ) GetInitialKeybindings ( ) [ ] * Binding {
2020-10-03 14:54:55 +10:00
config := gui . Config . GetUserConfig ( ) . Keybinding
2018-09-17 21:02:30 +10:00
bindings := [ ] * Binding {
2018-09-01 12:10:03 +02:00
{
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Quit ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleQuit ) ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-10-07 12:34:12 +11:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . QuitWithoutChangingDirectory ) ,
2019-10-07 12:34:12 +11:00
Modifier : gocui . ModNone ,
Handler : gui . handleQuitWithoutChangingDirectory ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . QuitAlt1 ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleQuit ) ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Return ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
2020-07-18 19:41:13 +10:00
Handler : gui . handleTopLevelReturn ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-05-03 10:33:25 +05:30
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . ScrollUpMain ) ,
2019-05-03 10:33:25 +05:30
Handler : gui . scrollUpMain ,
Alternative : "fn+up" ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcScrollUpMainPanel ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-05-03 10:33:25 +05:30
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . ScrollDownMain ) ,
2019-05-03 10:33:25 +05:30
Handler : gui . scrollDownMain ,
Alternative : "fn+down" ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcScrollDownMainPanel ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-05-25 16:37:47 +10:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . ScrollUpMainAlt1 ) ,
2019-05-25 16:37:47 +10:00
Modifier : gocui . ModNone ,
Handler : gui . scrollUpMain ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-05-25 16:37:47 +10:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . ScrollDownMainAlt1 ) ,
2019-05-25 16:37:47 +10:00
Modifier : gocui . ModNone ,
Handler : gui . scrollDownMain ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . ScrollUpMainAlt2 ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
Handler : gui . scrollUpMain ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . ScrollDownMainAlt2 ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
Handler : gui . scrollDownMain ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-19 23:36:29 +11:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . CreateRebaseOptionsMenu ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleCreateRebaseOptionsMenu ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ViewMergeRebaseOptions ,
2019-11-16 12:41:04 +11:00
} ,
2020-01-03 13:01:32 +01:00
{
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . CreatePatchOptionsMenu ) ,
2020-01-03 13:01:32 +01:00
Handler : gui . handleCreatePatchOptionsMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ViewPatchOptions ,
2020-01-03 13:01:32 +01:00
} ,
2019-11-16 12:41:04 +11:00
{
2018-09-05 13:23:06 +02:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PushFiles ) ,
2018-09-05 13:23:06 +02:00
Handler : gui . pushFiles ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcPush ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-05 13:23:06 +02:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PullFiles ) ,
2019-11-13 21:16:24 +11:00
Handler : gui . handlePullFiles ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcPull ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-05 13:23:06 +02:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Refresh ) ,
2018-09-05 13:23:06 +02:00
Handler : gui . handleRefresh ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRefresh ,
2019-11-16 12:41:04 +11:00
} ,
{
2020-03-12 14:29:15 +09:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . OptionMenu ) ,
2020-03-12 14:29:15 +09:00
Handler : gui . handleCreateOptionsMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcOpenMenu ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-11-10 16:54:05 +11:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . OptionMenuAlt1 ) ,
2019-11-10 16:54:05 +11:00
Modifier : gocui . ModNone ,
Handler : gui . handleCreateOptionsMenu ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-11-10 16:20:35 +11:00
ViewName : "" ,
Key : gocui . MouseMiddle ,
Modifier : gocui . ModNone ,
Handler : gui . handleCreateOptionsMenu ,
2019-11-16 12:41:04 +11:00
} ,
2020-03-19 22:22:00 +11:00
{
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Undo ) ,
2020-03-19 22:22:00 +11:00
Handler : gui . reflogUndo ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcUndoReflog ,
2020-03-19 22:22:00 +11:00
} ,
2020-03-21 13:39:20 +11:00
{
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Redo ) ,
2020-03-21 13:39:20 +11:00
Handler : gui . reflogRedo ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRedoReflog ,
2020-03-21 13:39:20 +11:00
} ,
2019-11-16 12:41:04 +11:00
{
2018-09-01 12:10:03 +02:00
ViewName : "status" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Edit ) ,
2018-09-01 12:10:03 +02:00
Handler : gui . handleEditConfig ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . EditConfig ,
2020-02-25 08:32:46 +11:00
} ,
{
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextScreenMode ) ,
2020-02-25 08:32:46 +11:00
Handler : gui . nextScreenMode ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcNextScreenMode ,
2020-02-25 08:32:46 +11:00
} ,
{
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevScreenMode ) ,
2020-02-25 08:32:46 +11:00
Handler : gui . prevScreenMode ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcPrevScreenMode ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "status" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . OpenFile ) ,
2018-09-01 12:10:03 +02:00
Handler : gui . handleOpenConfig ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . OpenConfig ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "status" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Status . CheckForUpdate ) ,
2018-09-01 12:10:03 +02:00
Handler : gui . handleCheckForUpdate ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCheckForUpdate ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-19 18:40:41 +10:00
ViewName : "status" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Status . RecentRepos ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleCreateRecentReposMenu ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . SwitchRepo ,
2018-09-19 18:40:41 +10:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . CommitChanges ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleCommitPress ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . CommitChanges ,
2019-04-13 13:56:31 +10:00
} ,
{
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . CommitChangesWithoutHook ) ,
2019-04-13 13:56:31 +10:00
Handler : gui . handleWIPCommitPress ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCommitChangesWithoutHook ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-12 15:20:35 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . AmendLastCommit ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleAmendCommitPress ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . AmendLastCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . CommitChangesWithEditor ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleCommitEditorPress ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . CommitChangesWithEditor ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-03 18:44:56 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleFilePress ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcToggleStaged ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:03:43 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2019-03-18 20:44:33 +11:00
Handler : gui . handleCreateDiscardMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewDiscardOptions ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Edit ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleFileEdit ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcEditFile ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . OpenFile ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleFileOpen ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcOpenFile ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . IgnoreFile ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleIgnoreFile ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcIgnoreFile ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . RefreshFiles ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleRefreshFiles ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRefreshFiles ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-05-30 22:45:56 +10:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . StashAllChanges ) ,
2019-05-30 22:45:56 +10:00
Handler : gui . handleStashChanges ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcStashAllChanges ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . ViewStashOptions ) ,
2019-05-30 22:45:56 +10:00
Handler : gui . handleCreateStashMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewStashOptions ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . ToggleStagedAll ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleStageAll ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcToggleStagedAll ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . ViewResetOptions ) ,
2019-03-18 21:40:32 +11:00
Handler : gui . handleCreateResetMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewResetOptions ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-12-02 19:57:01 +11:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2018-12-05 22:30:10 +11:00
Handler : gui . handleEnterFile ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . StageLines ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-12-12 22:33:42 +11:00
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . Fetch ) ,
2018-12-12 22:33:42 +11:00
Handler : gui . handleGitFetch ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcFetch ,
2019-11-16 12:41:04 +11:00
} ,
2020-09-19 19:55:52 +09:00
{
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . CopyToClipboard ) ,
2020-09-19 19:55:52 +09:00
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCopyFileNameToClipboard ,
2020-09-19 19:55:52 +09:00
} ,
2019-11-16 12:41:04 +11:00
{
2020-02-24 21:55:51 +11:00
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . ExecuteCustomCommand ) ,
2019-03-12 21:43:56 +11:00
Handler : gui . handleCustomCommand ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcExecuteCustomCommand ,
2019-11-16 12:41:04 +11:00
} ,
2020-02-16 09:21:23 +11:00
{
ViewName : "files" ,
2020-09-30 08:27:23 +10:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ViewResetOptions ) ,
2020-02-16 09:21:23 +11:00
Handler : gui . handleCreateResetToUpstreamMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewResetToUpstreamOptions ,
2020-02-16 09:21:23 +11:00
} ,
2019-11-16 12:41:04 +11:00
{
2018-09-03 18:44:56 +02:00
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2018-09-03 18:44:56 +02:00
Handler : gui . handleBranchPress ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCheckout ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-10-12 14:06:03 +02:00
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . CreatePullRequest ) ,
2018-10-12 14:06:03 +02:00
Handler : gui . handleCreatePullRequestPress ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCreatePullRequest ,
2019-11-16 12:41:04 +11:00
} ,
2020-11-10 14:57:50 -05:00
{
ViewName : "branches" ,
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
Key : gui . getKey ( config . Branches . CopyPullRequestURL ) ,
Handler : gui . handleCopyPullRequestURLPress ,
Description : gui . Tr . LcCopyPullRequestURL ,
} ,
2019-11-16 12:41:04 +11:00
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . CheckoutBranchByName ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleCheckoutByName ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCheckoutByName ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . ForceCheckoutBranch ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleForceCheckout ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcForceCheckout ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . New ) ,
2020-08-22 09:55:49 +10:00
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcNewBranch ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleDeleteBranch ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcDeleteBranch ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-11-29 17:57:51 +01:00
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . RebaseBranch ) ,
2019-11-17 14:04:57 +11:00
Handler : gui . handleRebaseOntoLocalBranch ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRebaseBranch ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . MergeIntoCurrentBranch ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleMerge ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcMergeIntoCurrentBranch ,
2019-11-16 12:41:04 +11:00
} ,
2020-01-07 21:42:33 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . ViewGitFlowOptions ) ,
2020-01-07 21:42:33 +11:00
Handler : gui . handleCreateGitFlowMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcGitFlowOptions ,
2020-01-07 21:42:33 +11:00
} ,
2019-11-16 12:41:04 +11:00
{
2018-12-07 18:52:31 +11:00
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . FastForward ) ,
2018-12-07 18:52:31 +11:00
Handler : gui . handleFastForward ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . FastForward ,
2019-11-16 12:41:04 +11:00
} ,
2020-02-16 09:03:26 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ViewResetOptions ) ,
2020-02-16 09:03:26 +11:00
Handler : gui . handleCreateResetToBranchMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewResetOptions ,
2020-02-16 09:03:26 +11:00
} ,
2020-03-17 21:22:07 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . RenameBranch ) ,
2020-03-17 21:22:07 +11:00
Handler : gui . handleRenameBranch ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRenameBranch ,
2020-03-17 21:22:07 +11:00
} ,
2020-04-15 20:30:24 +10:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . CopyToClipboard ) ,
2020-08-22 12:07:03 +10:00
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCopyBranchNameToClipboard ,
2020-04-15 20:30:24 +10:00
} ,
2020-08-22 08:49:02 +10:00
{
ViewName : "branches" ,
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2020-08-22 08:49:02 +10:00
Handler : gui . wrappedHandler ( gui . handleSwitchToSubCommits ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewCommits ,
2020-08-22 08:49:02 +10:00
} ,
2019-11-18 09:38:36 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2019-11-18 09:38:36 +11:00
Handler : gui . handleCheckoutTag ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCheckout ,
2019-11-18 09:38:36 +11:00
} ,
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2019-11-18 09:38:36 +11:00
Handler : gui . handleDeleteTag ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcDeleteTag ,
2019-11-18 09:38:36 +11:00
} ,
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . PushTag ) ,
2019-11-18 09:38:36 +11:00
Handler : gui . handlePushTag ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcPushTag ,
2019-11-18 09:38:36 +11:00
} ,
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . New ) ,
2019-11-18 09:38:36 +11:00
Handler : gui . handleCreateTag ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCreateTag ,
2019-11-18 09:38:36 +11:00
} ,
2020-02-16 09:09:48 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ViewResetOptions ) ,
2020-02-16 09:09:48 +11:00
Handler : gui . handleCreateResetToTagMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewResetOptions ,
2020-02-16 09:09:48 +11:00
} ,
2020-08-22 08:49:02 +10:00
{
ViewName : "branches" ,
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2020-08-22 08:49:02 +10:00
Handler : gui . wrappedHandler ( gui . handleSwitchToSubCommits ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewCommits ,
2020-08-22 08:49:02 +10:00
} ,
2019-11-16 17:35:59 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Return ) ,
2019-11-16 17:35:59 +11:00
Handler : gui . handleRemoteBranchesEscape ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ReturnToRemotesList ,
2019-11-16 17:35:59 +11:00
} ,
2020-02-16 09:05:15 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ViewResetOptions ) ,
2020-02-16 09:05:15 +11:00
Handler : gui . handleCreateResetToRemoteBranchMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewResetOptions ,
2020-02-16 09:05:15 +11:00
} ,
2020-08-22 08:49:02 +10:00
{
ViewName : "branches" ,
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2020-08-22 08:49:02 +10:00
Handler : gui . wrappedHandler ( gui . handleSwitchToSubCommits ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewCommits ,
2020-08-22 08:49:02 +10:00
} ,
2019-12-07 16:20:22 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . FetchRemote ) ,
2019-12-07 16:20:22 +11:00
Handler : gui . handleFetchRemote ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcFetchRemote ,
2019-12-07 16:20:22 +11:00
} ,
2019-11-16 12:41:04 +11:00
{
2018-09-01 14:20:45 +02:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . SquashDown ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleCommitSquashDown ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcSquashDown ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . RenameCommit ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleRenameCommit ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRenameCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-03 18:01:07 +02:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . RenameCommitWithEditor ) ,
2018-09-03 18:01:07 +02:00
Handler : gui . handleRenameCommitEditor ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRenameCommitEditor ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ViewResetOptions ) ,
2019-04-02 19:53:16 +11:00
Handler : gui . handleCreateCommitResetMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcResetToThisCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . MarkCommitAsFixup ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleCommitFixup ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcFixupCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-04-07 11:35:34 +10:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . CreateFixupCommit ) ,
2019-04-07 11:35:34 +10:00
Handler : gui . handleCreateFixupCommit ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCreateFixupCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-04-07 11:35:34 +10:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . SquashAboveCommits ) ,
2019-04-07 11:35:34 +10:00
Handler : gui . handleSquashAllAboveFixupCommits ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcSquashAboveCommits ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-18 23:27:54 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2019-02-18 23:27:54 +11:00
Handler : gui . handleCommitDelete ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcDeleteCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-18 23:27:54 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . MoveDownCommit ) ,
2019-02-18 23:27:54 +11:00
Handler : gui . handleCommitMoveDown ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcMoveDownCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-18 23:27:54 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . MoveUpCommit ) ,
2019-02-18 23:27:54 +11:00
Handler : gui . handleCommitMoveUp ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcMoveUpCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-18 23:27:54 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Edit ) ,
2019-02-18 23:27:54 +11:00
Handler : gui . handleCommitEdit ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcEditCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-19 23:36:29 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . AmendToCommit ) ,
2019-02-19 23:36:29 +11:00
Handler : gui . handleCommitAmendTo ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcAmendToCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-19 23:36:29 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . PickCommit ) ,
2019-02-19 23:36:29 +11:00
Handler : gui . handleCommitPick ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcPickCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-19 23:36:29 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . RevertCommit ) ,
2019-02-19 23:36:29 +11:00
Handler : gui . handleCommitRevert ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRevertCommit ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-24 13:51:52 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . CherryPickCopy ) ,
2020-08-22 11:05:37 +10:00
Handler : gui . wrappedHandler ( gui . handleCopyCommit ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCherryPickCopy ,
2019-11-16 12:41:04 +11:00
} ,
2020-04-15 20:30:24 +10:00
{
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . CopyToClipboard ) ,
2020-08-22 12:07:03 +10:00
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCopyCommitShaToClipboard ,
2020-04-15 20:30:24 +10:00
} ,
2019-11-16 12:41:04 +11:00
{
2019-02-24 13:51:52 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . CherryPickCopyRange ) ,
2020-08-22 11:05:37 +10:00
Handler : gui . wrappedHandler ( gui . handleCopyCommitRange ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCherryPickCopyRange ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-02-24 13:51:52 +11:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . PasteCommits ) ,
2020-08-22 11:05:37 +10:00
Handler : gui . wrappedHandler ( gui . HandlePasteCommits ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcPasteCommits ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-03-09 23:42:10 +09:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2020-08-21 09:12:45 +10:00
Handler : gui . wrappedHandler ( gui . handleViewCommitFiles ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewCommitFiles ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-03-23 22:46:08 +09:00
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . CheckoutCommit ) ,
2020-01-07 20:24:10 +11:00
Handler : gui . handleCheckoutCommit ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCheckoutCommit ,
2020-01-07 20:24:10 +11:00
} ,
2020-08-16 22:01:14 +10:00
{
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . New ) ,
2020-08-16 22:01:14 +10:00
Modifier : gocui . ModNone ,
2020-08-22 09:55:49 +10:00
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCreateNewBranchFromCommit ,
2020-08-16 22:01:14 +10:00
} ,
2019-11-18 09:38:36 +11:00
{
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . TagCommit ) ,
2019-11-18 09:38:36 +11:00
Handler : gui . handleTagCommit ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcTagCommit ,
2019-11-18 09:38:36 +11:00
} ,
2020-03-19 08:45:21 +11:00
{
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ResetCherryPick ) ,
2020-08-22 11:57:44 +10:00
Handler : gui . wrappedHandler ( gui . exitCherryPickingMode ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcResetCherryPick ,
2020-03-19 08:45:21 +11:00
} ,
2020-10-12 11:13:19 +03:00
{
ViewName : "commits" ,
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( config . Commits . CopyCommitMessageToClipboard ) ,
Handler : gui . wrappedHandler ( gui . handleCopySelectedCommitMessageToClipboard ) ,
Description : gui . Tr . LcCopyCommitMessageToClipboard ,
} ,
2020-08-21 09:12:45 +10:00
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2020-08-21 09:12:45 +10:00
Handler : gui . wrappedHandler ( gui . handleViewReflogCommitFiles ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewCommitFiles ,
2020-08-21 09:12:45 +10:00
} ,
2020-01-09 22:08:28 +11:00
{
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2020-01-09 22:08:28 +11:00
Handler : gui . handleCheckoutReflogCommit ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCheckoutCommit ,
2020-01-09 22:08:28 +11:00
} ,
2020-01-09 22:23:28 +11:00
{
ViewName : "commits" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ViewResetOptions ) ,
2020-01-09 22:23:28 +11:00
Handler : gui . handleCreateReflogResetMenu ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewResetOptions ,
2020-01-09 22:23:28 +11:00
} ,
2020-08-22 11:57:44 +10:00
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . CherryPickCopy ) ,
2020-08-22 11:57:44 +10:00
Handler : gui . wrappedHandler ( gui . handleCopyCommit ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCherryPickCopy ,
2020-08-22 11:57:44 +10:00
} ,
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . CherryPickCopyRange ) ,
2020-08-22 11:57:44 +10:00
Handler : gui . wrappedHandler ( gui . handleCopyCommitRange ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCherryPickCopyRange ,
2020-08-22 11:57:44 +10:00
} ,
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ResetCherryPick ) ,
2020-08-22 11:57:44 +10:00
Handler : gui . wrappedHandler ( gui . exitCherryPickingMode ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcResetCherryPick ,
2020-08-22 11:57:44 +10:00
} ,
2020-08-22 12:07:03 +10:00
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . CopyToClipboard ) ,
2020-08-22 12:07:03 +10:00
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCopyCommitShaToClipboard ,
2020-09-19 19:55:52 +09:00
} ,
{
ViewName : "commitFiles" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . CopyToClipboard ) ,
2020-09-19 19:55:52 +09:00
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCopyCommitFileNameToClipboard ,
2020-08-22 12:07:03 +10:00
} ,
2020-08-22 08:49:02 +10:00
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2020-08-22 08:49:02 +10:00
Handler : gui . wrappedHandler ( gui . handleViewSubCommitFiles ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewCommitFiles ,
2020-08-22 08:49:02 +10:00
} ,
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2020-08-22 08:49:02 +10:00
Handler : gui . handleCheckoutSubCommit ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCheckoutCommit ,
2020-08-22 08:49:02 +10:00
} ,
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ViewResetOptions ) ,
2020-08-22 08:49:02 +10:00
Handler : gui . wrappedHandler ( gui . handleCreateSubCommitResetMenu ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewResetOptions ,
2020-08-22 08:49:02 +10:00
} ,
2020-08-22 09:55:49 +10:00
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . New ) ,
2020-08-22 09:55:49 +10:00
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcNewBranch ,
2020-08-22 09:55:49 +10:00
} ,
2020-08-22 11:05:37 +10:00
{
2020-08-22 11:44:03 +10:00
ViewName : "branches" ,
2020-08-22 11:05:37 +10:00
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . CherryPickCopy ) ,
2020-08-22 11:05:37 +10:00
Handler : gui . wrappedHandler ( gui . handleCopyCommit ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCherryPickCopy ,
2020-08-22 11:05:37 +10:00
} ,
2020-08-22 11:57:44 +10:00
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . CherryPickCopyRange ) ,
2020-08-22 11:57:44 +10:00
Handler : gui . wrappedHandler ( gui . handleCopyCommitRange ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCherryPickCopyRange ,
2020-08-22 11:57:44 +10:00
} ,
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Commits . ResetCherryPick ) ,
2020-08-22 11:57:44 +10:00
Handler : gui . wrappedHandler ( gui . exitCherryPickingMode ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcResetCherryPick ,
2020-08-22 11:57:44 +10:00
} ,
2020-08-22 12:07:03 +10:00
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . CopyToClipboard ) ,
2020-08-22 12:07:03 +10:00
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCopyCommitShaToClipboard ,
2020-08-22 12:07:03 +10:00
} ,
2020-08-21 19:53:45 +10:00
{
ViewName : "stash" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2020-08-21 19:53:45 +10:00
Handler : gui . wrappedHandler ( gui . handleViewStashFiles ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewStashFiles ,
2020-08-21 19:53:45 +10:00
} ,
2019-11-16 12:41:04 +11:00
{
2018-09-01 14:20:45 +02:00
ViewName : "stash" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleStashApply ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcApply ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "stash" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Stash . PopStash ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleStashPop ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcPop ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "stash" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleStashDrop ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcDrop ,
2019-11-16 12:41:04 +11:00
} ,
2020-08-22 10:08:44 +10:00
{
ViewName : "stash" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . New ) ,
2020-08-22 10:08:44 +10:00
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcNewBranch ,
2020-08-22 10:08:44 +10:00
} ,
2019-11-16 12:41:04 +11:00
{
2018-09-01 12:10:03 +02:00
ViewName : "commitMessage" ,
2020-10-13 08:16:24 +11:00
Key : gui . getKey ( config . Universal . SubmitEditorText ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleCommitConfirm ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "commitMessage" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Return ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleCommitClose ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-12-10 07:51:06 +01:00
ViewName : "credentials" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Confirm ) ,
2018-10-20 17:37:55 +02:00
Modifier : gocui . ModNone ,
2018-12-18 22:19:32 +11:00
Handler : gui . handleSubmitCredential ,
2019-11-16 12:41:04 +11:00
} ,
{
2018-12-10 07:51:06 +01:00
ViewName : "credentials" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Return ) ,
2018-10-20 17:37:55 +02:00
Modifier : gocui . ModNone ,
2018-12-18 22:19:32 +11:00
Handler : gui . handleCloseCredentialsView ,
2019-11-16 12:41:04 +11:00
} ,
{
2020-03-12 14:26:11 +09:00
ViewName : "menu" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Return ) ,
2020-03-12 14:26:11 +09:00
Handler : gui . handleMenuClose ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCloseMenu ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-03-03 14:28:16 +11:00
ViewName : "information" ,
2019-02-25 22:11:35 +11:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
2020-03-28 16:28:35 +11:00
Handler : gui . handleInfoClick ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-03-11 09:28:47 +11:00
ViewName : "commitFiles" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . CommitFiles . CheckoutCommitFile ) ,
2019-03-11 09:53:46 +11:00
Handler : gui . handleCheckoutCommitFile ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCheckoutCommitFile ,
2019-11-16 12:41:04 +11:00
} ,
{
2019-03-11 13:04:08 +11:00
ViewName : "commitFiles" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2019-03-11 13:04:08 +11:00
Handler : gui . handleDiscardOldFileChange ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcDiscardOldFileChange ,
2018-09-01 12:10:03 +02:00
} ,
2019-03-15 13:29:27 +11:00
{
ViewName : "commitFiles" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . OpenFile ) ,
2019-03-15 13:29:27 +11:00
Handler : gui . handleOpenOldCommitFile ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcOpenFile ,
2019-03-15 13:29:27 +11:00
} ,
2019-11-04 19:47:25 +11:00
{
ViewName : "commitFiles" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Edit ) ,
2020-07-21 18:12:05 +10:00
Handler : gui . handleEditCommitFile ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcEditFile ,
2020-07-21 18:12:05 +10:00
} ,
{
ViewName : "commitFiles" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2019-11-04 19:47:25 +11:00
Handler : gui . handleToggleFileForPatch ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcToggleAddToPatch ,
2019-11-04 19:47:25 +11:00
} ,
{
ViewName : "commitFiles" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2019-11-04 19:47:25 +11:00
Handler : gui . handleEnterCommitFile ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcEnterFile ,
2019-11-04 19:47:25 +11:00
} ,
2020-03-28 16:28:35 +11:00
{
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . FilteringMenu ) ,
2020-03-29 14:34:17 +11:00
Handler : gui . handleCreateFilteringMenuPanel ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcOpenScopingMenu ,
2020-03-28 16:28:35 +11:00
} ,
2020-03-29 14:34:17 +11:00
{
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . DiffingMenu ) ,
2020-03-29 14:34:17 +11:00
Handler : gui . handleCreateDiffingMenuPanel ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcOpenDiffingMenu ,
2020-03-29 14:34:17 +11:00
} ,
2020-08-25 09:07:16 +10:00
{
ViewName : "" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . DiffingMenuAlt ) ,
2020-08-25 09:07:16 +10:00
Handler : gui . handleCreateDiffingMenuPanel ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcOpenDiffingMenu ,
2020-08-25 09:07:16 +10:00
} ,
2019-11-10 16:50:36 +11:00
{
ViewName : "secondary" ,
Key : gocui . MouseWheelUp ,
Modifier : gocui . ModNone ,
Handler : gui . scrollUpSecondary ,
} ,
{
ViewName : "secondary" ,
Key : gocui . MouseWheelDown ,
Modifier : gocui . ModNone ,
Handler : gui . scrollDownSecondary ,
} ,
2019-11-16 12:41:04 +11:00
{
ViewName : "secondary" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_NORMAL_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
Handler : gui . handleMouseDownSecondary ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_NORMAL_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseWheelDown ,
Handler : gui . scrollDownMain ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ScrollDown ,
2019-11-16 12:41:04 +11:00
Alternative : "fn+up" ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_NORMAL_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseWheelUp ,
Handler : gui . scrollUpMain ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ScrollUp ,
2019-11-16 12:41:04 +11:00
Alternative : "fn+down" ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_NORMAL_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
Handler : gui . handleMouseDownMain ,
} ,
{
ViewName : "secondary" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
Handler : gui . handleTogglePanelClick ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Return ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleStagingEscape ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ReturnToFilesPanel ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2020-10-08 08:01:04 +11:00
Handler : gui . wrappedHandler ( gui . handleToggleStagedSelection ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . StageSelection ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2020-10-08 08:01:04 +11:00
Handler : gui . wrappedHandler ( gui . handleResetSelection ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ResetSelection ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . TogglePanel ) ,
2020-10-08 08:01:04 +11:00
Handler : gui . wrappedHandler ( gui . handleTogglePanel ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . TogglePanel ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Return ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleEscapePatchBuildingPanel ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ExitLineByLineMode ,
2019-11-16 12:41:04 +11:00
} ,
2020-08-15 10:58:29 +10:00
{
2020-08-15 11:23:14 +10:00
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . OpenFile ) ,
2020-08-15 11:23:14 +10:00
Handler : gui . wrappedHandler ( gui . handleOpenFileAtLine ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcOpenFile ,
2020-08-15 10:58:29 +10:00
} ,
2019-11-16 12:41:04 +11:00
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevItem ) ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleSelectPrevLine ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . PrevLine ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextItem ) ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleSelectNextLine ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . NextLine ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevItemAlt ) ,
2019-11-16 12:41:04 +11:00
Modifier : gocui . ModNone ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleSelectPrevLine ) ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextItemAlt ) ,
2019-11-16 12:41:04 +11:00
Modifier : gocui . ModNone ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleSelectNextLine ) ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseWheelUp ,
Modifier : gocui . ModNone ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleSelectPrevLine ) ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseWheelDown ,
Modifier : gocui . ModNone ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleSelectNextLine ) ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevBlock ) ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleSelectPrevHunk ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . PrevHunk ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevBlockAlt ) ,
2019-11-16 12:41:04 +11:00
Modifier : gocui . ModNone ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleSelectPrevHunk ) ,
} ,
{
ViewName : "main" ,
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
Key : gui . getKey ( config . Universal . NextBlock ) ,
Handler : gui . wrappedHandler ( gui . handleSelectNextHunk ) ,
Description : gui . Tr . NextHunk ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextBlockAlt ) ,
2019-11-16 12:41:04 +11:00
Modifier : gocui . ModNone ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleSelectNextHunk ) ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Edit ) ,
2019-11-16 12:41:04 +11:00
Handler : gui . handleFileEdit ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcEditFile ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . OpenFile ) ,
2019-11-16 12:41:04 +11:00
Handler : gui . handleFileOpen ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcOpenFile ,
2019-11-16 12:41:04 +11:00
} ,
2020-10-02 07:56:14 +10:00
{
ViewName : "main" ,
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
Key : gui . getKey ( config . Universal . NextPage ) ,
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . handleLineByLineNextPage ) ,
Description : gui . Tr . LcNextPage ,
Tag : "navigation" ,
} ,
{
ViewName : "main" ,
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
Key : gui . getKey ( config . Universal . PrevPage ) ,
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . handleLineByLinePrevPage ) ,
Description : gui . Tr . LcPrevPage ,
Tag : "navigation" ,
} ,
{
ViewName : "main" ,
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
Key : gui . getKey ( config . Universal . GotoTop ) ,
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . handleLineByLineGotoTop ) ,
Description : gui . Tr . LcGotoTop ,
Tag : "navigation" ,
} ,
{
ViewName : "main" ,
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
Key : gui . getKey ( config . Universal . GotoBottom ) ,
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . handleLineByLineGotoBottom ) ,
Description : gui . Tr . LcGotoBottom ,
Tag : "navigation" ,
} ,
{
ViewName : "main" ,
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
Key : gui . getKey ( config . Universal . StartSearch ) ,
Handler : gui . handleOpenSearch ,
Description : gui . Tr . LcStartSearch ,
Tag : "navigation" ,
} ,
2019-11-16 12:41:04 +11:00
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2020-10-07 17:54:45 +11:00
Handler : gui . wrappedHandler ( gui . handleToggleSelectionForPatch ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ToggleSelectionForPatch ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Main . ToggleDragSelect ) ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleToggleSelectRange ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ToggleDragSelect ,
2019-11-16 12:41:04 +11:00
} ,
2019-11-27 20:35:41 +01:00
// Alias 'V' -> 'v'
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Main . ToggleDragSelectAlt ) ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleToggleSelectRange ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ToggleDragSelect ,
2019-11-27 20:35:41 +01:00
} ,
2019-11-16 12:41:04 +11:00
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Main . ToggleSelectHunk ) ,
2020-10-02 07:56:14 +10:00
Handler : gui . wrappedHandler ( gui . handleToggleSelectHunk ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ToggleSelectHunk ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
2020-10-02 07:56:14 +10:00
Handler : gui . handleLBLMouseDown ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModMotion ,
Handler : gui . handleMouseDrag ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseWheelUp ,
Modifier : gocui . ModNone ,
Handler : gui . handleMouseScrollUp ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseWheelDown ,
Modifier : gocui . ModNone ,
Handler : gui . handleMouseScrollDown ,
} ,
2020-02-03 14:18:03 +01:00
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . CommitChanges ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleCommitPress ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . CommitChanges ,
2020-02-03 14:18:03 +01:00
} ,
2020-02-04 12:43:56 +01:00
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . CommitChangesWithoutHook ) ,
2020-02-04 12:43:56 +01:00
Handler : gui . handleWIPCommitPress ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCommitChangesWithoutHook ,
2020-02-04 12:43:56 +01:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Files . CommitChangesWithEditor ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleCommitEditorPress ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . CommitChangesWithEditor ,
2020-02-04 12:43:56 +01:00
} ,
2019-11-16 12:41:04 +11:00
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Return ) ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleEscapeMerge ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . ReturnToFilesPanel ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2019-11-16 12:41:04 +11:00
Handler : gui . handlePickHunk ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . PickHunk ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Main . PickBothHunks ) ,
2019-11-16 12:41:04 +11:00
Handler : gui . handlePickBothHunks ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . PickBothHunks ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevBlock ) ,
2019-11-16 12:41:04 +11:00
Handler : gui . handleSelectPrevConflict ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . PrevConflict ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextBlock ) ,
2019-11-16 12:41:04 +11:00
Handler : gui . handleSelectNextConflict ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . NextConflict ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevItem ) ,
2019-11-16 12:41:04 +11:00
Handler : gui . handleSelectTop ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . SelectTop ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextItem ) ,
2019-11-16 12:41:04 +11:00
Handler : gui . handleSelectBottom ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . SelectBottom ,
2019-11-16 12:41:04 +11:00
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseWheelUp ,
Modifier : gocui . ModNone ,
Handler : gui . handleSelectTop ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-11-16 12:41:04 +11:00
Key : gocui . MouseWheelDown ,
Modifier : gocui . ModNone ,
Handler : gui . handleSelectBottom ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevBlockAlt ) ,
2019-11-16 12:41:04 +11:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectPrevConflict ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextBlockAlt ) ,
2019-11-16 12:41:04 +11:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectNextConflict ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevItemAlt ) ,
2019-11-16 12:41:04 +11:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectTop ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextItemAlt ) ,
2019-11-16 12:41:04 +11:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectBottom ,
} ,
{
ViewName : "main" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Undo ) ,
2019-11-16 12:41:04 +11:00
Handler : gui . handlePopFileSnapshot ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcUndo ,
2019-11-16 12:41:04 +11:00
} ,
2019-11-16 17:35:59 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2019-11-16 17:35:59 +11:00
Modifier : gocui . ModNone ,
2020-08-15 17:23:16 +10:00
Handler : gui . wrappedHandler ( gui . handleRemoteEnter ) ,
2019-11-16 17:35:59 +11:00
} ,
2019-11-17 12:02:39 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . New ) ,
2019-11-17 12:02:39 +11:00
Handler : gui . handleAddRemote ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcAddNewRemote ,
2019-11-17 12:02:39 +11:00
} ,
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2019-11-17 12:02:39 +11:00
Handler : gui . handleRemoveRemote ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRemoveRemote ,
2019-11-17 12:02:39 +11:00
} ,
2019-11-17 18:15:32 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Edit ) ,
2019-11-17 18:15:32 +11:00
Handler : gui . handleEditRemote ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcEditRemote ,
2019-11-17 18:15:32 +11:00
} ,
2019-11-17 12:07:36 +11:00
{
2020-08-25 19:24:14 +10:00
ViewName : "branches" ,
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2020-08-25 19:24:14 +10:00
// gonna use the exact same handler as the 'n' keybinding because everybody wants this to happen when they checkout a remote branch
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCheckout ,
2019-11-17 12:07:36 +11:00
} ,
2020-05-18 21:04:50 +10:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . New ) ,
2020-08-22 09:55:49 +10:00
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcNewBranch ,
2020-05-18 21:04:50 +10:00
} ,
2019-11-17 13:21:38 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . MergeIntoCurrentBranch ) ,
2019-11-17 13:21:38 +11:00
Handler : gui . handleMergeRemoteBranch ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcMergeIntoCurrentBranch ,
2019-11-17 13:21:38 +11:00
} ,
2019-11-17 13:47:47 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2019-11-17 13:47:47 +11:00
Handler : gui . handleDeleteRemoteBranch ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcDeleteBranch ,
2019-11-17 13:47:47 +11:00
} ,
2019-11-17 14:04:57 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . RebaseBranch ) ,
2019-11-17 14:04:57 +11:00
Handler : gui . handleRebaseOntoRemoteBranch ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcRebaseBranch ,
2019-11-17 14:04:57 +11:00
} ,
2019-11-17 14:50:12 +11:00
{
ViewName : "branches" ,
2020-08-20 19:42:58 +10:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Branches . SetUpstream ) ,
2019-11-17 14:50:12 +11:00
Handler : gui . handleSetBranchUpstream ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcSetUpstream ,
2019-11-17 14:50:12 +11:00
} ,
2019-11-16 14:00:27 +11:00
{
ViewName : "status" ,
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
Handler : gui . handleStatusClick ,
} ,
2020-02-23 21:53:30 +11:00
{
ViewName : "search" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Confirm ) ,
2020-02-23 21:53:30 +11:00
Modifier : gocui . ModNone ,
Handler : gui . handleSearch ,
} ,
{
ViewName : "search" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Return ) ,
2020-02-23 21:53:30 +11:00
Modifier : gocui . ModNone ,
Handler : gui . handleSearchEscape ,
} ,
2020-03-26 21:39:59 +11:00
{
ViewName : "confirmation" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevItem ) ,
2020-03-26 21:39:59 +11:00
Modifier : gocui . ModNone ,
Handler : gui . scrollUpConfirmationPanel ,
} ,
{
ViewName : "confirmation" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextItem ) ,
2020-03-26 21:39:59 +11:00
Modifier : gocui . ModNone ,
Handler : gui . scrollDownConfirmationPanel ,
} ,
{
ViewName : "confirmation" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevItemAlt ) ,
2020-03-26 21:39:59 +11:00
Modifier : gocui . ModNone ,
Handler : gui . scrollUpConfirmationPanel ,
} ,
{
ViewName : "confirmation" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextItemAlt ) ,
2020-03-26 21:39:59 +11:00
Modifier : gocui . ModNone ,
Handler : gui . scrollDownConfirmationPanel ,
} ,
2020-08-20 08:24:35 +10:00
{
ViewName : "menu" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Select ) ,
2020-08-20 08:24:35 +10:00
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . onMenuPress ) ,
} ,
{
ViewName : "menu" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Confirm ) ,
2020-08-20 08:24:35 +10:00
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . onMenuPress ) ,
} ,
{
ViewName : "menu" ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . ConfirmAlt1 ) ,
2020-08-20 08:24:35 +10:00
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . onMenuPress ) ,
} ,
2020-09-30 08:27:23 +10:00
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . CopyToClipboard ) ,
2020-09-30 08:27:23 +10:00
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcCopySubmoduleNameToClipboard ,
2020-09-30 08:27:23 +10:00
} ,
2020-10-01 08:18:16 +10:00
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . GoInto ) ,
2020-10-01 08:18:16 +10:00
Handler : gui . forSubmodule ( gui . handleSubmoduleEnter ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcEnterSubmodule ,
2020-10-01 08:18:16 +10:00
} ,
2020-09-30 09:06:11 +10:00
{
2020-10-01 09:04:09 +10:00
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Remove ) ,
2020-10-01 09:04:09 +10:00
Handler : gui . forSubmodule ( gui . handleResetRemoveSubmodule ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewResetAndRemoveOptions ,
2020-09-30 09:06:11 +10:00
} ,
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Submodules . Update ) ,
2020-10-01 09:04:09 +10:00
Handler : gui . forSubmodule ( gui . handleUpdateSubmodule ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcSubmoduleUpdate ,
2020-09-30 09:06:11 +10:00
} ,
2020-09-30 21:12:03 +10:00
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . New ) ,
2020-09-30 21:12:03 +10:00
Handler : gui . wrappedHandler ( gui . handleAddSubmodule ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcAddSubmodule ,
2020-09-30 21:12:03 +10:00
} ,
2020-09-30 22:05:34 +10:00
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . Edit ) ,
2020-10-01 08:18:16 +10:00
Handler : gui . forSubmodule ( gui . handleEditSubmoduleUrl ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcEditSubmoduleUrl ,
2020-09-30 22:05:34 +10:00
} ,
2020-10-01 08:18:16 +10:00
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Submodules . Init ) ,
2020-10-01 08:18:16 +10:00
Handler : gui . forSubmodule ( gui . handleSubmoduleInit ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcInitSubmodule ,
2020-10-01 08:18:16 +10:00
} ,
2020-10-01 22:13:32 +10:00
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Submodules . BulkMenu ) ,
2020-10-01 22:13:32 +10:00
Handler : gui . wrappedHandler ( gui . handleBulkSubmoduleActionsMenu ) ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcViewBulkSubmoduleOptions ,
2020-10-01 22:13:32 +10:00
} ,
2018-08-08 19:18:41 +10:00
}
2018-08-09 23:26:31 +10:00
2019-03-11 13:04:08 +11:00
for _ , viewName := range [ ] string { "status" , "branches" , "files" , "commits" , "commitFiles" , "stash" , "menu" } {
2018-09-17 21:02:30 +10:00
bindings = append ( bindings , [ ] * Binding {
2020-10-03 14:54:55 +10:00
{ ViewName : viewName , Key : gui . getKey ( config . Universal . PrevBlock ) , Modifier : gocui . ModNone , Handler : gui . wrappedHandler ( gui . previousSideWindow ) } ,
{ ViewName : viewName , Key : gui . getKey ( config . Universal . NextBlock ) , Modifier : gocui . ModNone , Handler : gui . wrappedHandler ( gui . nextSideWindow ) } ,
{ ViewName : viewName , Key : gui . getKey ( config . Universal . PrevBlockAlt ) , Modifier : gocui . ModNone , Handler : gui . wrappedHandler ( gui . previousSideWindow ) } ,
{ ViewName : viewName , Key : gui . getKey ( config . Universal . NextBlockAlt ) , Modifier : gocui . ModNone , Handler : gui . wrappedHandler ( gui . nextSideWindow ) } ,
2018-08-09 23:26:31 +10:00
} ... )
}
2019-07-27 12:16:26 +01:00
// Appends keybindings to jump to a particular sideView using numbers
2020-08-16 13:58:29 +10:00
for i , window := range [ ] string { "status" , "files" , "branches" , "commits" , "stash" } {
bindings = append ( bindings , & Binding { ViewName : "" , Key : rune ( i + 1 ) + '0' , Modifier : gocui . ModNone , Handler : gui . goToSideWindow ( window ) } )
2019-07-27 12:16:26 +01:00
}
2020-10-02 07:32:48 +10:00
for viewName := range gui . viewTabContextMap ( ) {
bindings = append ( bindings , [ ] * Binding {
{
ViewName : viewName ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . NextTab ) ,
2020-10-02 07:32:48 +10:00
Handler : gui . handleNextTab ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcNextTab ,
2020-10-02 07:32:48 +10:00
Tag : "navigation" ,
} ,
{
ViewName : viewName ,
2020-10-03 14:54:55 +10:00
Key : gui . getKey ( config . Universal . PrevTab ) ,
2020-10-02 07:32:48 +10:00
Handler : gui . handlePrevTab ,
2020-10-04 11:00:48 +11:00
Description : gui . Tr . LcPrevTab ,
2020-10-02 07:32:48 +10:00
Tag : "navigation" ,
} ,
} ... )
}
2020-08-17 22:04:20 +10:00
bindings = append ( bindings , gui . getListContextKeyBindings ( ) ... )
2018-12-07 18:52:31 +11:00
2018-08-28 20:07:13 +02:00
return bindings
}
2020-08-23 17:34:49 +10:00
func ( gui * Gui ) keybindings ( ) error {
2020-09-26 15:23:28 +10:00
bindings := gui . GetCustomCommandKeybindings ( )
bindings = append ( bindings , gui . GetInitialKeybindings ( ) ... )
2018-08-28 20:07:13 +02:00
2018-08-08 19:18:41 +10:00
for _ , binding := range bindings {
2020-08-23 17:34:49 +10:00
if err := gui . g . SetKeybinding ( binding . ViewName , binding . Contexts , binding . Key , binding . Modifier , binding . Handler ) ; err != nil {
2018-08-08 19:18:41 +10:00
return err
}
}
2019-11-13 23:18:31 +11:00
2020-09-30 08:27:12 +10:00
for viewName := range gui . viewTabContextMap ( ) {
2020-10-02 20:05:45 +10:00
viewName := viewName
2020-09-30 08:27:12 +10:00
tabClickCallback := func ( tabIndex int ) error { return gui . onViewTabClick ( viewName , tabIndex ) }
2020-01-09 21:34:17 +11:00
2020-09-30 08:27:12 +10:00
if err := gui . g . SetTabClickBinding ( viewName , tabClickCallback ) ; err != nil {
2020-01-09 21:34:17 +11:00
return err
}
2019-11-13 23:18:31 +11:00
}
2019-02-16 12:07:27 +11:00
return nil
}