2018-08-12 11:31:27 +02:00
package gui
2018-08-08 11:18:41 +02:00
2018-09-17 13:02:30 +02:00
import (
2020-09-23 11:49:41 +02:00
"fmt"
2019-12-05 05:16:47 +02:00
"log"
2019-12-05 04:01:01 +02:00
"strings"
2020-01-07 12:42:33 +02:00
2020-08-12 11:19:32 +02:00
"unicode/utf8"
2020-01-07 12:42:33 +02:00
"github.com/jesseduffield/gocui"
2018-09-17 13:02:30 +02:00
)
2018-08-08 11:18:41 +02: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 03:41:04 +02: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 07:03:25 +02:00
Alternative string
2018-08-08 11:18:41 +02:00
}
2018-09-17 13:02:30 +02:00
// GetDisplayStrings returns the display string of a file
2019-02-16 06:17:44 +02:00
func ( b * Binding ) GetDisplayStrings ( isFocused bool ) [ ] string {
2020-01-07 19:50:25 +02:00
return [ ] string { GetKeyDisplay ( b . Key ) , b . Description }
2018-09-17 13:02:30 +02:00
}
2020-01-06 17:37:33 +02: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 19:50:25 +02:00
gocui . KeyArrowUp : "▲" ,
gocui . KeyArrowDown : "▼" ,
gocui . KeyArrowLeft : "◄" ,
gocui . KeyArrowRight : "►" ,
2020-01-06 17:37:33 +02: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 02:38:07 +02:00
gocui . KeyCtrlSlash : "ctrl+/" , // ctrl+_
2020-01-06 17:37:33 +02: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 02:38:07 +02:00
gocui . KeyCtrl4 : "ctrl+4" , // ctrl+\
gocui . KeyCtrl5 : "ctrl+5" , // ctrl+]
2020-01-06 17:37:33 +02:00
gocui . KeyCtrl6 : "ctrl+6" ,
gocui . KeyCtrl8 : "ctrl+8" ,
}
2019-12-05 04:01:01 +02: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 19:50:25 +02: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 02:34:10 +02:00
switch key := key . ( type ) {
2020-01-07 19:50:25 +02:00
case rune :
2020-03-09 02:34:10 +02:00
keyInt = int ( key )
2020-01-07 19:50:25 +02:00
case gocui . Key :
2020-03-09 02:34:10 +02:00
value , ok := keyMapReversed [ key ]
2020-01-07 19:50:25 +02:00
if ok {
return value
}
2020-03-09 02:34:10 +02:00
keyInt = int ( key )
2020-01-07 19:50:25 +02:00
}
2020-09-23 11:49:41 +02:00
return fmt . Sprintf ( "%c" , keyInt )
2020-01-07 19:50:25 +02:00
}
2019-12-05 04:01:01 +02:00
func ( gui * Gui ) getKey ( name string ) interface { } {
key := gui . Config . GetUserConfig ( ) . GetString ( "keybinding." + name )
2020-09-26 07:23:28 +02:00
if key == "" {
// if we don't have the keybinding in our local config we'll assume it's just a plain letter from a custom command
key = name
}
2020-08-12 11:19:32 +02:00
runeCount := utf8 . RuneCountInString ( key )
if runeCount > 1 {
2019-12-05 05:16:47 +02:00
binding := keymap [ strings . ToLower ( key ) ]
if binding == nil {
2020-09-27 01:37:22 +02:00
log . Fatalf ( "Unrecognized key %s for keybinding %s. For permitted values see https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md" , strings . ToLower ( key ) , name )
2019-12-05 05:16:47 +02:00
} else {
return binding
}
2020-08-12 11:19:32 +02:00
} else if runeCount == 1 {
2019-12-05 04:01:01 +02:00
return [ ] rune ( key ) [ 0 ]
}
2019-12-07 08:39:41 +02:00
log . Fatal ( "Key empty for keybinding: " + strings . ToLower ( name ) )
2019-12-05 04:01:01 +02:00
return nil
}
2019-02-16 03:07:27 +02:00
// GetInitialKeybindings is a function.
func ( gui * Gui ) GetInitialKeybindings ( ) [ ] * Binding {
2018-09-17 13:02:30 +02:00
bindings := [ ] * Binding {
2018-09-01 12:10:03 +02:00
{
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.quit" ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleQuit ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-10-07 03:34:12 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.quitWithoutChangingDirectory" ) ,
2019-10-07 03:34:12 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleQuitWithoutChangingDirectory ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.quit-alt1" ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleQuit ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.return" ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
2020-07-18 11:41:13 +02:00
Handler : gui . handleTopLevelReturn ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-05-03 07:03:25 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.scrollUpMain" ) ,
2019-05-03 07:03:25 +02:00
Handler : gui . scrollUpMain ,
Alternative : "fn+up" ,
2020-02-29 00:17:19 +02:00
Description : gui . Tr . SLocalize ( "scrollUpMainPanel" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-05-03 07:03:25 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.scrollDownMain" ) ,
2019-05-03 07:03:25 +02:00
Handler : gui . scrollDownMain ,
Alternative : "fn+down" ,
2020-02-29 00:17:19 +02:00
Description : gui . Tr . SLocalize ( "scrollDownMainPanel" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-05-25 08:37:47 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.scrollUpMain-alt1" ) ,
2019-05-25 08:37:47 +02:00
Modifier : gocui . ModNone ,
Handler : gui . scrollUpMain ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-05-25 08:37:47 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.scrollDownMain-alt1" ) ,
2019-05-25 08:37:47 +02:00
Modifier : gocui . ModNone ,
Handler : gui . scrollDownMain ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.scrollUpMain-alt2" ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
Handler : gui . scrollUpMain ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.scrollDownMain-alt2" ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
Handler : gui . scrollDownMain ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-19 14:36:29 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.createRebaseOptionsMenu" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleCreateRebaseOptionsMenu ) ,
2019-02-19 14:36:29 +02:00
Description : gui . Tr . SLocalize ( "ViewMergeRebaseOptions" ) ,
2019-11-16 03:41:04 +02:00
} ,
2020-01-03 14:01:32 +02:00
{
ViewName : "" ,
2020-01-04 10:12:36 +02:00
Key : gui . getKey ( "universal.createPatchOptionsMenu" ) ,
2020-01-03 14:01:32 +02:00
Handler : gui . handleCreatePatchOptionsMenu ,
Description : gui . Tr . SLocalize ( "ViewPatchOptions" ) ,
} ,
2019-11-16 03:41:04 +02:00
{
2018-09-05 13:23:06 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.pushFiles" ) ,
2018-09-05 13:23:06 +02:00
Handler : gui . pushFiles ,
2018-09-05 13:01:21 +02:00
Description : gui . Tr . SLocalize ( "push" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-05 13:23:06 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.pullFiles" ) ,
2019-11-13 12:16:24 +02:00
Handler : gui . handlePullFiles ,
2018-09-05 13:01:21 +02:00
Description : gui . Tr . SLocalize ( "pull" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-05 13:23:06 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.refresh" ) ,
2018-09-05 13:23:06 +02:00
Handler : gui . handleRefresh ,
2018-09-05 13:01:21 +02:00
Description : gui . Tr . SLocalize ( "refresh" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2020-03-12 07:29:15 +02:00
ViewName : "" ,
Key : gui . getKey ( "universal.optionMenu" ) ,
Handler : gui . handleCreateOptionsMenu ,
Description : gui . Tr . SLocalize ( "openMenu" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-11-10 07:54:05 +02:00
ViewName : "" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.optionMenu-alt1" ) ,
2019-11-10 07:54:05 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleCreateOptionsMenu ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-11-10 07:20:35 +02:00
ViewName : "" ,
Key : gocui . MouseMiddle ,
Modifier : gocui . ModNone ,
Handler : gui . handleCreateOptionsMenu ,
2019-11-16 03:41:04 +02:00
} ,
2020-03-19 13:22:00 +02:00
{
ViewName : "" ,
2020-03-21 04:39:20 +02:00
Key : gui . getKey ( "universal.undo" ) ,
2020-03-19 13:22:00 +02:00
Handler : gui . reflogUndo ,
Description : gui . Tr . SLocalize ( "undoReflog" ) ,
} ,
2020-03-21 04:39:20 +02:00
{
ViewName : "" ,
Key : gui . getKey ( "universal.redo" ) ,
Handler : gui . reflogRedo ,
Description : gui . Tr . SLocalize ( "redoReflog" ) ,
} ,
2019-11-16 03:41:04 +02:00
{
2018-09-01 12:10:03 +02:00
ViewName : "status" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.edit" ) ,
2018-09-01 12:10:03 +02:00
Handler : gui . handleEditConfig ,
Description : gui . Tr . SLocalize ( "EditConfig" ) ,
2020-02-24 23:32:46 +02:00
} ,
{
ViewName : "" ,
Key : gui . getKey ( "universal.nextScreenMode" ) ,
Handler : gui . nextScreenMode ,
Description : gui . Tr . SLocalize ( "nextScreenMode" ) ,
} ,
{
ViewName : "" ,
Key : gui . getKey ( "universal.prevScreenMode" ) ,
Handler : gui . prevScreenMode ,
Description : gui . Tr . SLocalize ( "prevScreenMode" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "status" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.openFile" ) ,
2018-09-01 12:10:03 +02:00
Handler : gui . handleOpenConfig ,
Description : gui . Tr . SLocalize ( "OpenConfig" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "status" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "status.checkForUpdate" ) ,
2018-09-01 12:10:03 +02:00
Handler : gui . handleCheckForUpdate ,
2018-09-03 18:16:54 +02:00
Description : gui . Tr . SLocalize ( "checkForUpdate" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-19 10:40:41 +02:00
ViewName : "status" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "status.recentRepos" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleCreateRecentReposMenu ) ,
2018-09-19 10:40:41 +02:00
Description : gui . Tr . SLocalize ( "SwitchRepo" ) ,
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.commitChanges" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleCommitPress ) ,
2018-09-01 12:10:03 +02:00
Description : gui . Tr . SLocalize ( "CommitChanges" ) ,
2019-04-13 05:56:31 +02:00
} ,
{
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.commitChangesWithoutHook" ) ,
2019-04-13 05:56:31 +02:00
Handler : gui . handleWIPCommitPress ,
Description : gui . Tr . SLocalize ( "commitChangesWithoutHook" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-12 15:20:35 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.amendLastCommit" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleAmendCommitPress ) ,
2018-09-25 22:11:51 +02:00
Description : gui . Tr . SLocalize ( "AmendLastCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.commitChangesWithEditor" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleCommitEditorPress ) ,
2018-09-01 12:10:03 +02:00
Description : gui . Tr . SLocalize ( "CommitChangesWithEditor" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-03 18:44:56 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.select" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleFilePress ) ,
2018-09-03 18:44:56 +02:00
Description : gui . Tr . SLocalize ( "toggleStaged" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:03:43 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.remove" ) ,
2019-03-18 11:44:33 +02:00
Handler : gui . handleCreateDiscardMenu ,
Description : gui . Tr . SLocalize ( "viewDiscardOptions" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.edit" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleFileEdit ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "editFile" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.openFile" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleFileOpen ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "openFile" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.ignoreFile" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleIgnoreFile ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "ignoreFile" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.refreshFiles" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleRefreshFiles ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "refreshFiles" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-05-30 14:45:56 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.stashAllChanges" ) ,
2019-05-30 14:45:56 +02:00
Handler : gui . handleStashChanges ,
Description : gui . Tr . SLocalize ( "stashAllChanges" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.viewStashOptions" ) ,
2019-05-30 14:45:56 +02:00
Handler : gui . handleCreateStashMenu ,
Description : gui . Tr . SLocalize ( "viewStashOptions" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.toggleStagedAll" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleStageAll ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "toggleStagedAll" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.viewResetOptions" ) ,
2019-03-18 12:40:32 +02:00
Handler : gui . handleCreateResetMenu ,
Description : gui . Tr . SLocalize ( "viewResetOptions" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-12-02 10:57:01 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-07 08:36:52 +02:00
Key : gui . getKey ( "universal.goInto" ) ,
2018-12-05 13:30:10 +02:00
Handler : gui . handleEnterFile ,
2018-12-02 10:57:01 +02:00
Description : gui . Tr . SLocalize ( "StageLines" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-12-12 13:33:42 +02:00
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "files.fetch" ) ,
2018-12-12 13:33:42 +02:00
Handler : gui . handleGitFetch ,
Description : gui . Tr . SLocalize ( "fetch" ) ,
2019-11-16 03:41:04 +02:00
} ,
2020-09-19 12:55:52 +02:00
{
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-09-19 12:55:52 +02:00
Key : gui . getKey ( "universal.copyToClipboard" ) ,
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
Description : gui . Tr . SLocalize ( "copyFileNameToClipboard" ) ,
} ,
2019-11-16 03:41:04 +02:00
{
2020-02-24 12:55:51 +02:00
ViewName : "" ,
2019-12-07 08:36:52 +02:00
Key : gui . getKey ( "universal.executeCustomCommand" ) ,
2019-03-12 12:43:56 +02:00
Handler : gui . handleCustomCommand ,
Description : gui . Tr . SLocalize ( "executeCustomCommand" ) ,
2019-11-16 03:41:04 +02:00
} ,
2020-02-16 00:21:23 +02:00
{
ViewName : "files" ,
2020-09-30 00:27:23 +02:00
Contexts : [ ] string { FILES_CONTEXT_KEY } ,
2020-02-16 00:21:23 +02:00
Key : gui . getKey ( "commits.viewResetOptions" ) ,
Handler : gui . handleCreateResetToUpstreamMenu ,
2020-02-16 00:49:00 +02:00
Description : gui . Tr . SLocalize ( "viewResetToUpstreamOptions" ) ,
2020-02-16 00:21:23 +02:00
} ,
2019-11-16 03:41:04 +02:00
{
2018-09-03 18:44:56 +02:00
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.select" ) ,
2018-09-03 18:44:56 +02:00
Handler : gui . handleBranchPress ,
Description : gui . Tr . SLocalize ( "checkout" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-10-12 14:06:03 +02:00
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "branches.createPullRequest" ) ,
2018-10-12 14:06:03 +02:00
Handler : gui . handleCreatePullRequestPress ,
Description : gui . Tr . SLocalize ( "createPullRequest" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2019-12-07 08:36:52 +02:00
Key : gui . getKey ( "branches.checkoutBranchByName" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleCheckoutByName ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "checkoutByName" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "branches.forceCheckoutBranch" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleForceCheckout ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "forceCheckout" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.new" ) ,
2020-08-22 01:55:49 +02:00
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "newBranch" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.remove" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleDeleteBranch ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "deleteBranch" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-11-29 18:57:51 +02:00
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "branches.rebaseBranch" ) ,
2019-11-17 05:04:57 +02:00
Handler : gui . handleRebaseOntoLocalBranch ,
2018-11-29 18:57:51 +02:00
Description : gui . Tr . SLocalize ( "rebaseBranch" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "branches.mergeIntoCurrentBranch" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleMerge ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "mergeIntoCurrentBranch" ) ,
2019-11-16 03:41:04 +02:00
} ,
2020-01-07 12:42:33 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-01-07 12:42:33 +02:00
Key : gui . getKey ( "branches.viewGitFlowOptions" ) ,
Handler : gui . handleCreateGitFlowMenu ,
Description : gui . Tr . SLocalize ( "gitFlowOptions" ) ,
} ,
2019-11-16 03:41:04 +02:00
{
2018-12-07 09:52:31 +02:00
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "branches.FastForward" ) ,
2018-12-07 09:52:31 +02:00
Handler : gui . handleFastForward ,
Description : gui . Tr . SLocalize ( "FastForward" ) ,
2019-11-16 03:41:04 +02:00
} ,
2020-02-16 00:03:26 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-02-16 00:03:26 +02:00
Key : gui . getKey ( "commits.viewResetOptions" ) ,
Handler : gui . handleCreateResetToBranchMenu ,
2020-02-16 00:49:00 +02:00
Description : gui . Tr . SLocalize ( "viewResetOptions" ) ,
2020-02-16 00:03:26 +02:00
} ,
2020-03-17 12:22:07 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-03-17 12:22:07 +02:00
Key : gui . getKey ( "branches.renameBranch" ) ,
Handler : gui . handleRenameBranch ,
2020-03-18 13:08:50 +02:00
Description : gui . Tr . SLocalize ( "renameBranch" ) ,
2020-03-17 12:22:07 +02:00
} ,
2020-04-15 12:30:24 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
2020-04-15 12:30:24 +02:00
Key : gui . getKey ( "universal.copyToClipboard" ) ,
2020-08-22 04:07:03 +02:00
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
2020-04-15 12:30:24 +02:00
Description : gui . Tr . SLocalize ( "copyBranchNameToClipboard" ) ,
} ,
2020-08-22 00:49:02 +02:00
{
ViewName : "branches" ,
Contexts : [ ] string { LOCAL_BRANCHES_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.goInto" ) ,
Handler : gui . wrappedHandler ( gui . handleSwitchToSubCommits ) ,
Description : gui . Tr . SLocalize ( "viewCommits" ) ,
} ,
2019-11-18 00:38:36 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.select" ) ,
2019-11-18 00:38:36 +02:00
Handler : gui . handleCheckoutTag ,
Description : gui . Tr . SLocalize ( "checkout" ) ,
} ,
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.remove" ) ,
2019-11-18 00:38:36 +02:00
Handler : gui . handleDeleteTag ,
Description : gui . Tr . SLocalize ( "deleteTag" ) ,
} ,
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "branches.pushTag" ) ,
2019-11-18 00:38:36 +02:00
Handler : gui . handlePushTag ,
2019-11-21 13:09:02 +02:00
Description : gui . Tr . SLocalize ( "pushTag" ) ,
2019-11-18 00:38:36 +02:00
} ,
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.new" ) ,
2019-11-18 00:38:36 +02:00
Handler : gui . handleCreateTag ,
Description : gui . Tr . SLocalize ( "createTag" ) ,
} ,
2020-02-16 00:09:48 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
2020-02-16 00:09:48 +02:00
Key : gui . getKey ( "commits.viewResetOptions" ) ,
Handler : gui . handleCreateResetToTagMenu ,
2020-02-16 00:49:00 +02:00
Description : gui . Tr . SLocalize ( "viewResetOptions" ) ,
2020-02-16 00:09:48 +02:00
} ,
2020-08-22 00:49:02 +02:00
{
ViewName : "branches" ,
Contexts : [ ] string { TAGS_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.goInto" ) ,
Handler : gui . wrappedHandler ( gui . handleSwitchToSubCommits ) ,
Description : gui . Tr . SLocalize ( "viewCommits" ) ,
} ,
2019-11-16 07:20:05 +02:00
{
2020-03-23 14:22:10 +02:00
ViewName : "branches" ,
Key : gui . getKey ( "universal.nextTab" ) ,
2020-08-19 11:26:05 +02:00
Handler : gui . handleNextTab ,
2020-03-23 14:22:10 +02:00
Description : gui . Tr . SLocalize ( "nextTab" ) ,
2019-11-16 07:20:05 +02:00
} ,
{
2020-03-23 14:22:10 +02:00
ViewName : "branches" ,
Key : gui . getKey ( "universal.prevTab" ) ,
2020-08-19 11:26:05 +02:00
Handler : gui . handlePrevTab ,
2020-03-23 14:22:10 +02:00
Description : gui . Tr . SLocalize ( "prevTab" ) ,
2019-11-16 07:20:05 +02:00
} ,
2019-11-16 08:35:59 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.return" ) ,
2019-11-16 08:35:59 +02:00
Handler : gui . handleRemoteBranchesEscape ,
Description : gui . Tr . SLocalize ( "ReturnToRemotesList" ) ,
} ,
2020-02-16 00:05:15 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-02-16 00:05:15 +02:00
Key : gui . getKey ( "commits.viewResetOptions" ) ,
Handler : gui . handleCreateResetToRemoteBranchMenu ,
2020-02-16 00:49:00 +02:00
Description : gui . Tr . SLocalize ( "viewResetOptions" ) ,
2020-02-16 00:05:15 +02:00
} ,
2020-08-22 00:49:02 +02:00
{
ViewName : "branches" ,
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.goInto" ) ,
Handler : gui . wrappedHandler ( gui . handleSwitchToSubCommits ) ,
Description : gui . Tr . SLocalize ( "viewCommits" ) ,
} ,
2019-12-07 07:20:22 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2019-12-07 19:26:17 +02:00
Key : gui . getKey ( "branches.fetchRemote" ) ,
2019-12-07 07:20:22 +02:00
Handler : gui . handleFetchRemote ,
Description : gui . Tr . SLocalize ( "fetchRemote" ) ,
} ,
2020-01-09 12:34:17 +02:00
{
2020-03-23 14:22:10 +02:00
ViewName : "commits" ,
Key : gui . getKey ( "universal.nextTab" ) ,
2020-08-19 11:26:05 +02:00
Handler : gui . handleNextTab ,
2020-03-23 14:22:10 +02:00
Description : gui . Tr . SLocalize ( "nextTab" ) ,
2020-01-09 12:34:17 +02:00
} ,
{
2020-03-23 14:22:10 +02:00
ViewName : "commits" ,
Key : gui . getKey ( "universal.prevTab" ) ,
2020-08-19 11:26:05 +02:00
Handler : gui . handlePrevTab ,
2020-03-23 14:22:10 +02:00
Description : gui . Tr . SLocalize ( "prevTab" ) ,
2020-01-09 12:34:17 +02:00
} ,
2019-11-16 03:41:04 +02:00
{
2018-09-01 14:20:45 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.squashDown" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleCommitSquashDown ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "squashDown" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.renameCommit" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleRenameCommit ,
2018-09-03 18:16:54 +02:00
Description : gui . Tr . SLocalize ( "renameCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-03 18:01:07 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.renameCommitWithEditor" ) ,
2018-09-03 18:01:07 +02:00
Handler : gui . handleRenameCommitEditor ,
2018-09-03 18:16:54 +02:00
Description : gui . Tr . SLocalize ( "renameCommitEditor" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-07 08:36:52 +02:00
Key : gui . getKey ( "commits.viewResetOptions" ) ,
2019-04-02 10:53:16 +02:00
Handler : gui . handleCreateCommitResetMenu ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "resetToThisCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-07 08:36:52 +02:00
Key : gui . getKey ( "commits.markCommitAsFixup" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleCommitFixup ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "fixupCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-04-07 03:35:34 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.createFixupCommit" ) ,
2019-04-07 03:35:34 +02:00
Handler : gui . handleCreateFixupCommit ,
Description : gui . Tr . SLocalize ( "createFixupCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-04-07 03:35:34 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.squashAboveCommits" ) ,
2019-04-07 03:35:34 +02:00
Handler : gui . handleSquashAllAboveFixupCommits ,
Description : gui . Tr . SLocalize ( "squashAboveCommits" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-18 14:27:54 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.remove" ) ,
2019-02-18 14:27:54 +02:00
Handler : gui . handleCommitDelete ,
Description : gui . Tr . SLocalize ( "deleteCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-18 14:27:54 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.moveDownCommit" ) ,
2019-02-18 14:27:54 +02:00
Handler : gui . handleCommitMoveDown ,
Description : gui . Tr . SLocalize ( "moveDownCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-18 14:27:54 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.moveUpCommit" ) ,
2019-02-18 14:27:54 +02:00
Handler : gui . handleCommitMoveUp ,
Description : gui . Tr . SLocalize ( "moveUpCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-18 14:27:54 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.edit" ) ,
2019-02-18 14:27:54 +02:00
Handler : gui . handleCommitEdit ,
Description : gui . Tr . SLocalize ( "editCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-19 14:36:29 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.amendToCommit" ) ,
2019-02-19 14:36:29 +02:00
Handler : gui . handleCommitAmendTo ,
Description : gui . Tr . SLocalize ( "amendToCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-19 14:36:29 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.pickCommit" ) ,
2019-02-19 14:36:29 +02:00
Handler : gui . handleCommitPick ,
Description : gui . Tr . SLocalize ( "pickCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-19 14:36:29 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.revertCommit" ) ,
2019-02-19 14:36:29 +02:00
Handler : gui . handleCommitRevert ,
Description : gui . Tr . SLocalize ( "revertCommit" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-24 04:51:52 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.cherryPickCopy" ) ,
2020-08-22 03:05:37 +02:00
Handler : gui . wrappedHandler ( gui . handleCopyCommit ) ,
2019-02-24 04:51:52 +02:00
Description : gui . Tr . SLocalize ( "cherryPickCopy" ) ,
2019-11-16 03:41:04 +02:00
} ,
2020-04-15 12:30:24 +02:00
{
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-04-15 12:30:24 +02:00
Key : gui . getKey ( "universal.copyToClipboard" ) ,
2020-08-22 04:07:03 +02:00
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
2020-04-15 12:30:24 +02:00
Description : gui . Tr . SLocalize ( "copyCommitShaToClipboard" ) ,
} ,
2019-11-16 03:41:04 +02:00
{
2019-02-24 04:51:52 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.cherryPickCopyRange" ) ,
2020-08-22 03:05:37 +02:00
Handler : gui . wrappedHandler ( gui . handleCopyCommitRange ) ,
2019-02-24 04:51:52 +02:00
Description : gui . Tr . SLocalize ( "cherryPickCopyRange" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-02-24 04:51:52 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.pasteCommits" ) ,
2020-08-22 03:05:37 +02:00
Handler : gui . wrappedHandler ( gui . HandlePasteCommits ) ,
2019-02-24 04:51:52 +02:00
Description : gui . Tr . SLocalize ( "pasteCommits" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-03-09 16:42:10 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-07 08:36:52 +02:00
Key : gui . getKey ( "universal.goInto" ) ,
2020-08-21 01:12:45 +02:00
Handler : gui . wrappedHandler ( gui . handleViewCommitFiles ) ,
2019-03-11 00:28:47 +02:00
Description : gui . Tr . SLocalize ( "viewCommitFiles" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-03-23 15:46:08 +02:00
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-01-08 05:14:54 +02:00
Key : gui . getKey ( "commits.checkoutCommit" ) ,
2020-01-07 11:24:10 +02:00
Handler : gui . handleCheckoutCommit ,
Description : gui . Tr . SLocalize ( "checkoutCommit" ) ,
} ,
2020-08-16 14:01:14 +02:00
{
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-08-16 14:01:14 +02:00
Key : gui . getKey ( "universal.new" ) ,
Modifier : gocui . ModNone ,
2020-08-22 01:55:49 +02:00
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
2020-08-16 14:01:14 +02:00
Description : gui . Tr . SLocalize ( "createNewBranchFromCommit" ) ,
} ,
2019-11-18 00:38:36 +02:00
{
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commits.tagCommit" ) ,
2019-11-18 00:38:36 +02:00
Handler : gui . handleTagCommit ,
Description : gui . Tr . SLocalize ( "tagCommit" ) ,
} ,
2020-03-18 23:45:21 +02:00
{
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { BRANCH_COMMITS_CONTEXT_KEY } ,
2020-03-18 23:45:21 +02:00
Key : gui . getKey ( "commits.resetCherryPick" ) ,
2020-08-22 03:57:44 +02:00
Handler : gui . wrappedHandler ( gui . exitCherryPickingMode ) ,
2020-03-18 23:45:21 +02:00
Description : gui . Tr . SLocalize ( "resetCherryPick" ) ,
} ,
2020-08-21 01:12:45 +02:00
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.goInto" ) ,
Handler : gui . wrappedHandler ( gui . handleViewReflogCommitFiles ) ,
Description : gui . Tr . SLocalize ( "viewCommitFiles" ) ,
} ,
2020-01-09 13:08:28 +02:00
{
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
2020-01-09 13:08:28 +02:00
Key : gui . getKey ( "universal.select" ) ,
Handler : gui . handleCheckoutReflogCommit ,
Description : gui . Tr . SLocalize ( "checkoutCommit" ) ,
} ,
2020-01-09 13:23:28 +02:00
{
ViewName : "commits" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
2020-01-09 13:23:28 +02:00
Key : gui . getKey ( "commits.viewResetOptions" ) ,
Handler : gui . handleCreateReflogResetMenu ,
Description : gui . Tr . SLocalize ( "viewResetOptions" ) ,
} ,
2020-08-22 03:57:44 +02:00
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "commits.cherryPickCopy" ) ,
Handler : gui . wrappedHandler ( gui . handleCopyCommit ) ,
Description : gui . Tr . SLocalize ( "cherryPickCopy" ) ,
} ,
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "commits.cherryPickCopyRange" ) ,
Handler : gui . wrappedHandler ( gui . handleCopyCommitRange ) ,
Description : gui . Tr . SLocalize ( "cherryPickCopyRange" ) ,
} ,
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "commits.resetCherryPick" ) ,
Handler : gui . wrappedHandler ( gui . exitCherryPickingMode ) ,
Description : gui . Tr . SLocalize ( "resetCherryPick" ) ,
} ,
2020-08-22 04:07:03 +02:00
{
ViewName : "commits" ,
Contexts : [ ] string { REFLOG_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.copyToClipboard" ) ,
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
Description : gui . Tr . SLocalize ( "copyCommitShaToClipboard" ) ,
2020-09-19 12:55:52 +02:00
} ,
{
ViewName : "commitFiles" ,
Key : gui . getKey ( "universal.copyToClipboard" ) ,
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
Description : gui . Tr . SLocalize ( "copyCommitFileNameToClipboard" ) ,
2020-08-22 04:07:03 +02:00
} ,
2020-08-22 00:49:02 +02:00
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.goInto" ) ,
Handler : gui . wrappedHandler ( gui . handleViewSubCommitFiles ) ,
Description : gui . Tr . SLocalize ( "viewCommitFiles" ) ,
} ,
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.select" ) ,
Handler : gui . handleCheckoutSubCommit ,
Description : gui . Tr . SLocalize ( "checkoutCommit" ) ,
} ,
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "commits.viewResetOptions" ) ,
Handler : gui . wrappedHandler ( gui . handleCreateSubCommitResetMenu ) ,
Description : gui . Tr . SLocalize ( "viewResetOptions" ) ,
} ,
2020-08-22 01:55:49 +02:00
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.new" ) ,
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
Description : gui . Tr . SLocalize ( "newBranch" ) ,
} ,
2020-08-22 03:05:37 +02:00
{
2020-08-22 03:44:03 +02:00
ViewName : "branches" ,
2020-08-22 03:05:37 +02:00
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "commits.cherryPickCopy" ) ,
Handler : gui . wrappedHandler ( gui . handleCopyCommit ) ,
Description : gui . Tr . SLocalize ( "cherryPickCopy" ) ,
} ,
2020-08-22 03:57:44 +02:00
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "commits.cherryPickCopyRange" ) ,
Handler : gui . wrappedHandler ( gui . handleCopyCommitRange ) ,
Description : gui . Tr . SLocalize ( "cherryPickCopyRange" ) ,
} ,
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "commits.resetCherryPick" ) ,
Handler : gui . wrappedHandler ( gui . exitCherryPickingMode ) ,
Description : gui . Tr . SLocalize ( "resetCherryPick" ) ,
} ,
2020-08-22 04:07:03 +02:00
{
ViewName : "branches" ,
Contexts : [ ] string { SUB_COMMITS_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.copyToClipboard" ) ,
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
Description : gui . Tr . SLocalize ( "copyCommitShaToClipboard" ) ,
} ,
2020-08-21 11:53:45 +02:00
{
ViewName : "stash" ,
Key : gui . getKey ( "universal.goInto" ) ,
Handler : gui . wrappedHandler ( gui . handleViewStashFiles ) ,
Description : gui . Tr . SLocalize ( "viewStashFiles" ) ,
} ,
2019-11-16 03:41:04 +02:00
{
2018-09-01 14:20:45 +02:00
ViewName : "stash" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.select" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleStashApply ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "apply" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "stash" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "stash.popStash" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleStashPop ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "pop" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 14:20:45 +02:00
ViewName : "stash" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.remove" ) ,
2018-09-01 14:20:45 +02:00
Handler : gui . handleStashDrop ,
2018-09-01 14:03:43 +02:00
Description : gui . Tr . SLocalize ( "drop" ) ,
2019-11-16 03:41:04 +02:00
} ,
2020-08-22 02:08:44 +02:00
{
ViewName : "stash" ,
Key : gui . getKey ( "universal.new" ) ,
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
Description : gui . Tr . SLocalize ( "newBranch" ) ,
} ,
2019-11-16 03:41:04 +02:00
{
2018-09-01 12:10:03 +02:00
ViewName : "commitMessage" ,
2020-08-17 09:53:50 +02:00
Key : gui . getKey ( "universal.confirm" ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleCommitConfirm ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-09-01 12:10:03 +02:00
ViewName : "commitMessage" ,
2020-08-17 09:53:50 +02:00
Key : gui . getKey ( "universal.return" ) ,
2018-09-01 12:10:03 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleCommitClose ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-12-10 08:51:06 +02:00
ViewName : "credentials" ,
2020-08-17 09:53:50 +02:00
Key : gui . getKey ( "universal.confirm" ) ,
2018-10-20 17:37:55 +02:00
Modifier : gocui . ModNone ,
2018-12-18 13:19:32 +02:00
Handler : gui . handleSubmitCredential ,
2019-11-16 03:41:04 +02:00
} ,
{
2018-12-10 08:51:06 +02:00
ViewName : "credentials" ,
2020-08-17 09:53:50 +02:00
Key : gui . getKey ( "universal.return" ) ,
2018-10-20 17:37:55 +02:00
Modifier : gocui . ModNone ,
2018-12-18 13:19:32 +02:00
Handler : gui . handleCloseCredentialsView ,
2019-11-16 03:41:04 +02:00
} ,
{
2020-03-12 07:26:11 +02:00
ViewName : "menu" ,
Key : gui . getKey ( "universal.return" ) ,
Handler : gui . handleMenuClose ,
Description : gui . Tr . SLocalize ( "closeMenu" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-03-03 05:28:16 +02:00
ViewName : "information" ,
2019-02-25 13:11:35 +02:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
2020-03-28 07:28:35 +02:00
Handler : gui . handleInfoClick ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-03-11 00:28:47 +02:00
ViewName : "commitFiles" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "commitFiles.checkoutCommitFile" ) ,
2019-03-11 00:53:46 +02:00
Handler : gui . handleCheckoutCommitFile ,
Description : gui . Tr . SLocalize ( "checkoutCommitFile" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
2019-03-11 04:04:08 +02:00
ViewName : "commitFiles" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.remove" ) ,
2019-03-11 04:04:08 +02:00
Handler : gui . handleDiscardOldFileChange ,
Description : gui . Tr . SLocalize ( "discardOldFileChange" ) ,
2018-09-01 12:10:03 +02:00
} ,
2019-03-15 04:29:27 +02:00
{
ViewName : "commitFiles" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.openFile" ) ,
2019-03-15 04:29:27 +02:00
Handler : gui . handleOpenOldCommitFile ,
Description : gui . Tr . SLocalize ( "openFile" ) ,
} ,
2019-11-04 10:47:25 +02:00
{
ViewName : "commitFiles" ,
2020-07-21 10:12:05 +02:00
Key : gui . getKey ( "universal.edit" ) ,
Handler : gui . handleEditCommitFile ,
Description : gui . Tr . SLocalize ( "editFile" ) ,
} ,
{
ViewName : "commitFiles" ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.select" ) ,
2019-11-04 10:47:25 +02:00
Handler : gui . handleToggleFileForPatch ,
Description : gui . Tr . SLocalize ( "toggleAddToPatch" ) ,
} ,
{
ViewName : "commitFiles" ,
2019-12-07 08:36:52 +02:00
Key : gui . getKey ( "universal.goInto" ) ,
2019-11-04 10:47:25 +02:00
Handler : gui . handleEnterCommitFile ,
Description : gui . Tr . SLocalize ( "enterFile" ) ,
} ,
2020-03-28 07:28:35 +02:00
{
ViewName : "" ,
2020-03-29 01:11:15 +02:00
Key : gui . getKey ( "universal.filteringMenu" ) ,
2020-03-29 05:34:17 +02:00
Handler : gui . handleCreateFilteringMenuPanel ,
2020-03-28 07:28:35 +02:00
Description : gui . Tr . SLocalize ( "openScopingMenu" ) ,
} ,
2020-03-29 05:34:17 +02:00
{
ViewName : "" ,
Key : gui . getKey ( "universal.diffingMenu" ) ,
Handler : gui . handleCreateDiffingMenuPanel ,
Description : gui . Tr . SLocalize ( "openDiffingMenu" ) ,
} ,
2020-08-25 01:07:16 +02:00
{
ViewName : "" ,
Key : gui . getKey ( "universal.diffingMenu-alt" ) ,
Handler : gui . handleCreateDiffingMenuPanel ,
Description : gui . Tr . SLocalize ( "openDiffingMenu" ) ,
} ,
2019-11-10 07:50:36 +02: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 03:41:04 +02:00
{
ViewName : "secondary" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_NORMAL_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
Handler : gui . handleMouseDownSecondary ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_NORMAL_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseWheelDown ,
Handler : gui . scrollDownMain ,
Description : gui . Tr . SLocalize ( "ScrollDown" ) ,
Alternative : "fn+up" ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_NORMAL_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseWheelUp ,
Handler : gui . scrollUpMain ,
Description : gui . Tr . SLocalize ( "ScrollUp" ) ,
Alternative : "fn+down" ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_NORMAL_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
Handler : gui . handleMouseDownMain ,
} ,
{
ViewName : "secondary" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
Handler : gui . handleTogglePanelClick ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.return" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleStagingEscape ) ,
2019-11-16 03:41:04 +02:00
Description : gui . Tr . SLocalize ( "ReturnToFilesPanel" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.select" ) ,
2020-02-29 08:57:17 +02:00
Handler : gui . handleToggleStagedSelection ,
2019-11-16 03:41:04 +02:00
Description : gui . Tr . SLocalize ( "StageSelection" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.remove" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleResetSelection ,
Description : gui . Tr . SLocalize ( "ResetSelection" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.togglePanel" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleTogglePanel ,
Description : gui . Tr . SLocalize ( "TogglePanel" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.return" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleEscapePatchBuildingPanel ) ,
2019-11-16 03:41:04 +02:00
Description : gui . Tr . SLocalize ( "ExitLineByLineMode" ) ,
} ,
2020-08-15 02:58:29 +02:00
{
2020-08-15 03:23:14 +02:00
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2020-08-15 03:23:14 +02:00
Key : gui . getKey ( "universal.openFile" ) ,
Handler : gui . wrappedHandler ( gui . handleOpenFileAtLine ) ,
Description : gui . Tr . SLocalize ( "openFile" ) ,
2020-08-15 02:58:29 +02:00
} ,
2019-11-16 03:41:04 +02:00
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.prevItem" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleSelectPrevLine ,
Description : gui . Tr . SLocalize ( "PrevLine" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.nextItem" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleSelectNextLine ,
Description : gui . Tr . SLocalize ( "NextLine" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.prevItem-alt" ) ,
2019-11-16 03:41:04 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectPrevLine ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.nextItem-alt" ) ,
2019-11-16 03:41:04 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectNextLine ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseWheelUp ,
Modifier : gocui . ModNone ,
Handler : gui . handleSelectPrevLine ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseWheelDown ,
Modifier : gocui . ModNone ,
Handler : gui . handleSelectNextLine ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.prevBlock" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleSelectPrevHunk ,
Description : gui . Tr . SLocalize ( "PrevHunk" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.nextBlock" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleSelectNextHunk ,
Description : gui . Tr . SLocalize ( "NextHunk" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.prevBlock-alt" ) ,
2019-11-16 03:41:04 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectPrevHunk ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.nextBlock-alt" ) ,
2019-11-16 03:41:04 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectNextHunk ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.edit" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleFileEdit ,
Description : gui . Tr . SLocalize ( "editFile" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.openFile" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleFileOpen ,
Description : gui . Tr . SLocalize ( "openFile" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.select" ) ,
2020-02-29 09:44:08 +02:00
Handler : gui . handleToggleSelectionForPatch ,
Description : gui . Tr . SLocalize ( "ToggleSelectionForPatch" ) ,
2019-11-16 03:41:04 +02:00
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "main.toggleDragSelect" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleToggleSelectRange ,
Description : gui . Tr . SLocalize ( "ToggleDragSelect" ) ,
} ,
2019-11-27 21:35:41 +02:00
// Alias 'V' -> 'v'
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "main.toggleDragSelect-alt" ) ,
2019-11-27 21:35:41 +02:00
Handler : gui . handleToggleSelectRange ,
Description : gui . Tr . SLocalize ( "ToggleDragSelect" ) ,
} ,
2019-11-16 03:41:04 +02:00
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "main.toggleSelectHunk" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleToggleSelectHunk ,
Description : gui . Tr . SLocalize ( "ToggleSelectHunk" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
Handler : gui . handleMouseDown ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseLeft ,
Modifier : gocui . ModMotion ,
Handler : gui . handleMouseDrag ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseWheelUp ,
Modifier : gocui . ModNone ,
Handler : gui . handleMouseScrollUp ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_PATCH_BUILDING_CONTEXT_KEY , MAIN_STAGING_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseWheelDown ,
Modifier : gocui . ModNone ,
Handler : gui . handleMouseScrollDown ,
} ,
2020-02-03 15:18:03 +02:00
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-02-03 15:18:03 +02:00
Key : gui . getKey ( "files.commitChanges" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleCommitPress ) ,
2020-02-03 15:18:03 +02:00
Description : gui . Tr . SLocalize ( "CommitChanges" ) ,
} ,
2020-02-04 13:43:56 +02:00
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-02-04 13:43:56 +02:00
Key : gui . getKey ( "files.commitChangesWithoutHook" ) ,
Handler : gui . handleWIPCommitPress ,
Description : gui . Tr . SLocalize ( "commitChangesWithoutHook" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_STAGING_CONTEXT_KEY } ,
2020-02-04 13:43:56 +02:00
Key : gui . getKey ( "files.commitChangesWithEditor" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleCommitEditorPress ) ,
2020-02-04 13:43:56 +02:00
Description : gui . Tr . SLocalize ( "CommitChangesWithEditor" ) ,
} ,
2019-11-16 03:41:04 +02:00
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.return" ) ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleEscapeMerge ) ,
2019-11-16 03:41:04 +02:00
Description : gui . Tr . SLocalize ( "ReturnToFilesPanel" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.select" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handlePickHunk ,
Description : gui . Tr . SLocalize ( "PickHunk" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-01-06 17:37:21 +02:00
Key : gui . getKey ( "main.pickBothHunks" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handlePickBothHunks ,
Description : gui . Tr . SLocalize ( "PickBothHunks" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.prevBlock" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleSelectPrevConflict ,
Description : gui . Tr . SLocalize ( "PrevConflict" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.nextBlock" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleSelectNextConflict ,
Description : gui . Tr . SLocalize ( "NextConflict" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.prevItem" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleSelectTop ,
Description : gui . Tr . SLocalize ( "SelectTop" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.nextItem" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handleSelectBottom ,
Description : gui . Tr . SLocalize ( "SelectBottom" ) ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseWheelUp ,
Modifier : gocui . ModNone ,
Handler : gui . handleSelectTop ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-11-16 03:41:04 +02:00
Key : gocui . MouseWheelDown ,
Modifier : gocui . ModNone ,
Handler : gui . handleSelectBottom ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.prevBlock-alt" ) ,
2019-11-16 03:41:04 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectPrevConflict ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.nextBlock-alt" ) ,
2019-11-16 03:41:04 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectNextConflict ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.prevItem-alt" ) ,
2019-11-16 03:41:04 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectTop ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.nextItem-alt" ) ,
2019-11-16 03:41:04 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleSelectBottom ,
} ,
{
ViewName : "main" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { MAIN_MERGING_CONTEXT_KEY } ,
2020-03-21 04:39:20 +02:00
Key : gui . getKey ( "universal.undo" ) ,
2019-11-16 03:41:04 +02:00
Handler : gui . handlePopFileSnapshot ,
2020-03-21 03:31:26 +02:00
Description : gui . Tr . SLocalize ( "undo" ) ,
2019-11-16 03:41:04 +02:00
} ,
2019-11-16 08:35:59 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2019-12-07 08:36:52 +02:00
Key : gui . getKey ( "universal.goInto" ) ,
2019-11-16 08:35:59 +02:00
Modifier : gocui . ModNone ,
2020-08-15 09:23:16 +02:00
Handler : gui . wrappedHandler ( gui . handleRemoteEnter ) ,
2019-11-16 08:35:59 +02:00
} ,
2019-11-17 03:02:39 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.new" ) ,
2019-11-17 03:02:39 +02:00
Handler : gui . handleAddRemote ,
Description : gui . Tr . SLocalize ( "addNewRemote" ) ,
} ,
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.remove" ) ,
2019-11-17 03:02:39 +02:00
Handler : gui . handleRemoveRemote ,
Description : gui . Tr . SLocalize ( "removeRemote" ) ,
} ,
2019-11-17 09:15:32 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.edit" ) ,
2019-11-17 09:15:32 +02:00
Handler : gui . handleEditRemote ,
Description : gui . Tr . SLocalize ( "editRemote" ) ,
} ,
2019-11-17 03:07:36 +02:00
{
2020-08-25 11:24:14 +02:00
ViewName : "branches" ,
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.select" ) ,
// 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 ) ,
2019-11-17 03:07:36 +02:00
Description : gui . Tr . SLocalize ( "checkout" ) ,
} ,
2020-05-18 13:04:50 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2020-05-18 13:04:50 +02:00
Key : gui . getKey ( "universal.new" ) ,
2020-08-22 01:55:49 +02:00
Handler : gui . wrappedHandler ( gui . handleNewBranchOffCurrentItem ) ,
2020-05-18 13:04:50 +02:00
Description : gui . Tr . SLocalize ( "newBranch" ) ,
} ,
2019-11-17 04:21:38 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "branches.mergeIntoCurrentBranch" ) ,
2019-11-17 04:21:38 +02:00
Handler : gui . handleMergeRemoteBranch ,
Description : gui . Tr . SLocalize ( "mergeIntoCurrentBranch" ) ,
} ,
2019-11-17 04:47:47 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "universal.remove" ) ,
2019-11-17 04:47:47 +02:00
Handler : gui . handleDeleteRemoteBranch ,
Description : gui . Tr . SLocalize ( "deleteBranch" ) ,
} ,
2019-11-17 05:04:57 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "branches.rebaseBranch" ) ,
2019-11-17 05:04:57 +02:00
Handler : gui . handleRebaseOntoRemoteBranch ,
Description : gui . Tr . SLocalize ( "rebaseBranch" ) ,
} ,
2019-11-17 05:50:12 +02:00
{
ViewName : "branches" ,
2020-08-20 11:42:58 +02:00
Contexts : [ ] string { REMOTE_BRANCHES_CONTEXT_KEY } ,
2019-12-05 04:01:01 +02:00
Key : gui . getKey ( "branches.setUpstream" ) ,
2019-11-17 05:50:12 +02:00
Handler : gui . handleSetBranchUpstream ,
Description : gui . Tr . SLocalize ( "setUpstream" ) ,
} ,
2019-11-16 05:00:27 +02:00
{
ViewName : "status" ,
Key : gocui . MouseLeft ,
Modifier : gocui . ModNone ,
Handler : gui . handleStatusClick ,
} ,
2020-02-23 12:53:30 +02:00
{
ViewName : "search" ,
2020-08-17 09:53:50 +02:00
Key : gui . getKey ( "universal.confirm" ) ,
2020-02-23 12:53:30 +02:00
Modifier : gocui . ModNone ,
Handler : gui . handleSearch ,
} ,
{
ViewName : "search" ,
Key : gui . getKey ( "universal.return" ) ,
Modifier : gocui . ModNone ,
Handler : gui . handleSearchEscape ,
} ,
2020-03-26 12:39:59 +02:00
{
ViewName : "confirmation" ,
Key : gui . getKey ( "universal.prevItem" ) ,
Modifier : gocui . ModNone ,
Handler : gui . scrollUpConfirmationPanel ,
} ,
{
ViewName : "confirmation" ,
Key : gui . getKey ( "universal.nextItem" ) ,
Modifier : gocui . ModNone ,
Handler : gui . scrollDownConfirmationPanel ,
} ,
{
ViewName : "confirmation" ,
Key : gui . getKey ( "universal.prevItem-alt" ) ,
Modifier : gocui . ModNone ,
Handler : gui . scrollUpConfirmationPanel ,
} ,
{
ViewName : "confirmation" ,
Key : gui . getKey ( "universal.nextItem-alt" ) ,
Modifier : gocui . ModNone ,
Handler : gui . scrollDownConfirmationPanel ,
} ,
2020-08-20 00:24:35 +02:00
{
ViewName : "menu" ,
Key : gui . getKey ( "universal.select" ) ,
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . onMenuPress ) ,
} ,
{
ViewName : "menu" ,
Key : gui . getKey ( "universal.confirm" ) ,
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . onMenuPress ) ,
} ,
{
ViewName : "menu" ,
Key : gui . getKey ( "universal.confirm-alt1" ) ,
Modifier : gocui . ModNone ,
Handler : gui . wrappedHandler ( gui . onMenuPress ) ,
} ,
2020-09-30 00:27:23 +02:00
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.goInto" ) ,
Handler : gui . wrappedHandler ( gui . handleSubmoduleEnter ) ,
Description : gui . Tr . SLocalize ( "enterSubmodule" ) ,
} ,
{
ViewName : "files" ,
Key : gui . getKey ( "universal.nextTab" ) ,
Handler : gui . handleNextTab ,
Description : gui . Tr . SLocalize ( "nextTab" ) ,
} ,
{
ViewName : "files" ,
Key : gui . getKey ( "universal.prevTab" ) ,
Handler : gui . handlePrevTab ,
Description : gui . Tr . SLocalize ( "prevTab" ) ,
} ,
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.copyToClipboard" ) ,
Handler : gui . wrappedHandler ( gui . handleCopySelectedSideContextItemToClipboard ) ,
Description : gui . Tr . SLocalize ( "copySubmoduleNameToClipboard" ) ,
} ,
2020-09-30 01:06:11 +02:00
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
Key : gui . getKey ( "universal.remove" ) ,
Handler : gui . wrappedHandler ( gui . handleRemoveSubmodule ) ,
Description : gui . Tr . SLocalize ( "removeSubmodule" ) ,
} ,
{
ViewName : "files" ,
Contexts : [ ] string { SUBMODULES_CONTEXT_KEY } ,
Key : gui . getKey ( "u" ) ,
Handler : gui . wrappedHandler ( gui . handleResetSubmodule ) ,
Description : gui . Tr . SLocalize ( "submoduleStashAndReset" ) ,
} ,
2018-08-08 11:18:41 +02:00
}
2018-08-09 15:26:31 +02:00
2019-03-11 04:04:08 +02:00
for _ , viewName := range [ ] string { "status" , "branches" , "files" , "commits" , "commitFiles" , "stash" , "menu" } {
2018-09-17 13:02:30 +02:00
bindings = append ( bindings , [ ] * Binding {
2020-08-16 05:58:29 +02:00
{ ViewName : viewName , Key : gui . getKey ( "universal.prevBlock" ) , Modifier : gocui . ModNone , Handler : gui . wrappedHandler ( gui . previousSideWindow ) } ,
{ ViewName : viewName , Key : gui . getKey ( "universal.nextBlock" ) , Modifier : gocui . ModNone , Handler : gui . wrappedHandler ( gui . nextSideWindow ) } ,
{ ViewName : viewName , Key : gui . getKey ( "universal.prevBlock-alt" ) , Modifier : gocui . ModNone , Handler : gui . wrappedHandler ( gui . previousSideWindow ) } ,
{ ViewName : viewName , Key : gui . getKey ( "universal.nextBlock-alt" ) , Modifier : gocui . ModNone , Handler : gui . wrappedHandler ( gui . nextSideWindow ) } ,
2018-08-09 15:26:31 +02:00
} ... )
}
2019-07-27 13:16:26 +02:00
// Appends keybindings to jump to a particular sideView using numbers
2020-08-16 05:58:29 +02: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 13:16:26 +02:00
}
2020-08-17 14:04:20 +02:00
bindings = append ( bindings , gui . getListContextKeyBindings ( ) ... )
2018-12-07 09:52:31 +02:00
2018-08-28 20:07:13 +02:00
return bindings
}
2020-08-23 09:34:49 +02:00
func ( gui * Gui ) keybindings ( ) error {
2020-09-26 07:23:28 +02:00
bindings := gui . GetCustomCommandKeybindings ( )
bindings = append ( bindings , gui . GetInitialKeybindings ( ) ... )
2018-08-28 20:07:13 +02:00
2018-08-08 11:18:41 +02:00
for _ , binding := range bindings {
2020-08-23 09:34:49 +02:00
if err := gui . g . SetKeybinding ( binding . ViewName , binding . Contexts , binding . Key , binding . Modifier , binding . Handler ) ; err != nil {
2018-08-08 11:18:41 +02:00
return err
}
}
2019-11-13 14:18:31 +02:00
2020-09-30 00:27:12 +02:00
for viewName := range gui . viewTabContextMap ( ) {
tabClickCallback := func ( tabIndex int ) error { return gui . onViewTabClick ( viewName , tabIndex ) }
2020-01-09 12:34:17 +02:00
2020-09-30 00:27:12 +02:00
if err := gui . g . SetTabClickBinding ( viewName , tabClickCallback ) ; err != nil {
2020-01-09 12:34:17 +02:00
return err
}
2019-11-13 14:18:31 +02:00
}
2019-02-16 03:07:27 +02:00
return nil
}