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"
|
2021-04-11 15:32:20 +02:00
|
|
|
"github.com/jesseduffield/lazygit/pkg/constants"
|
2022-01-29 10:15:46 +02:00
|
|
|
"github.com/jesseduffield/lazygit/pkg/gui/context"
|
2022-01-28 11:44:36 +02:00
|
|
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
2018-09-17 13:02:30 +02:00
|
|
|
)
|
2018-08-08 11:18:41 +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: "►",
|
2021-04-11 15:32:20 +02:00
|
|
|
gocui.KeyTab: "tab", // ctrl+i
|
|
|
|
gocui.KeyBacktab: "shift+tab",
|
2021-04-02 06:08:15 +02:00
|
|
|
gocui.KeyEnter: "enter", // ctrl+m
|
|
|
|
gocui.KeyAltEnter: "alt+enter",
|
2020-01-06 17:37:33 +02:00
|
|
|
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,
|
2021-04-11 15:32:20 +02:00
|
|
|
"<backtab>": gocui.KeyBacktab,
|
2019-12-05 04:01:01 +02:00
|
|
|
"<enter>": gocui.KeyEnter,
|
2021-04-02 06:08:15 +02:00
|
|
|
"<a-enter>": gocui.KeyAltEnter,
|
2019-12-05 04:01:01 +02:00
|
|
|
"<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
|
|
|
}
|
|
|
|
|
2020-10-03 06:54:55 +02:00
|
|
|
func (gui *Gui) getKey(key string) interface{} {
|
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 {
|
2021-04-11 15:32:20 +02:00
|
|
|
log.Fatalf("Unrecognized key %s for keybinding. For permitted values see %s", strings.ToLower(key), constants.Links.Docs.CustomKeybindings)
|
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]
|
|
|
|
}
|
2020-10-03 06:54:55 +02:00
|
|
|
log.Fatal("Key empty for keybinding: " + strings.ToLower(key))
|
2019-12-05 04:01:01 +02:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2022-01-16 05:46:53 +02:00
|
|
|
func (gui *Gui) noPopupPanel(f func() error) func() error {
|
|
|
|
return func() error {
|
|
|
|
if gui.popupPanelFocused() {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return f()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-05 05:42:56 +02:00
|
|
|
func (gui *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBinding) {
|
2022-01-16 05:46:53 +02:00
|
|
|
config := gui.c.UserConfig.Keybinding
|
|
|
|
|
|
|
|
guards := types.KeybindingGuards{
|
|
|
|
OutsideFilterMode: gui.outsideFilterMode,
|
|
|
|
NoPopupPanel: gui.noPopupPanel,
|
|
|
|
}
|
2020-10-03 06:54:55 +02:00
|
|
|
|
2022-01-28 11:44:36 +02:00
|
|
|
bindings := []*types.Binding{
|
2018-09-01 12:10:03 +02:00
|
|
|
{
|
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Quit),
|
2018-09-01 12:10:03 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleQuit,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2019-10-07 03:34:12 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.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: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.QuitAlt1),
|
2018-09-01 12:10:03 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleQuit,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 12:10:03 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.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
|
|
|
},
|
2021-05-27 16:22:33 +02:00
|
|
|
{
|
|
|
|
ViewName: "",
|
|
|
|
Key: gui.getKey(config.Universal.OpenRecentRepos),
|
|
|
|
Handler: gui.handleCreateRecentReposMenu,
|
|
|
|
Alternative: "<c-r>",
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.SwitchRepo,
|
2021-05-27 16:22:33 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
2019-05-03 07:03:25 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.ScrollUpMain),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollUpMain,
|
2019-05-03 07:03:25 +02:00
|
|
|
Alternative: "fn+up",
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcScrollUpMainPanel,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2019-05-03 07:03:25 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.ScrollDownMain),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollDownMain,
|
2019-05-03 07:03:25 +02:00
|
|
|
Alternative: "fn+down",
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcScrollDownMainPanel,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2019-05-25 08:37:47 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.ScrollUpMainAlt1),
|
2019-05-25 08:37:47 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollUpMain,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2019-05-25 08:37:47 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.ScrollDownMainAlt1),
|
2019-05-25 08:37:47 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollDownMain,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 12:10:03 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.ScrollUpMainAlt2),
|
2018-09-01 12:10:03 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollUpMain,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 12:10:03 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.ScrollDownMainAlt2),
|
2018-09-01 12:10:03 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollDownMain,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2019-02-19 14:36:29 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.CreateRebaseOptionsMenu),
|
2022-01-31 13:11:34 +02:00
|
|
|
Handler: gui.helpers.Rebase.CreateRebaseOptionsMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ViewMergeRebaseOptions,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2020-01-03 14:01:32 +02:00
|
|
|
{
|
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.CreatePatchOptionsMenu),
|
2020-01-03 14:01:32 +02:00
|
|
|
Handler: gui.handleCreatePatchOptionsMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ViewPatchOptions,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2020-01-03 14:01:32 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
2018-09-05 13:23:06 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Refresh),
|
2018-09-05 13:23:06 +02:00
|
|
|
Handler: gui.handleRefresh,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcRefresh,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2020-03-12 07:29:15 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.OptionMenu),
|
2020-03-12 07:29:15 +02:00
|
|
|
Handler: gui.handleCreateOptionsMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcOpenMenu,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2019-11-10 07:54:05 +02:00
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.OptionMenuAlt1),
|
2019-11-10 07:54:05 +02:00
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.handleCreateOptionsMenu,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 12:10:03 +02:00
|
|
|
ViewName: "status",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Edit),
|
2018-09-01 12:10:03 +02:00
|
|
|
Handler: gui.handleEditConfig,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.EditConfig,
|
2020-02-24 23:32:46 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextScreenMode),
|
2020-02-24 23:32:46 +02:00
|
|
|
Handler: gui.nextScreenMode,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcNextScreenMode,
|
2020-02-24 23:32:46 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevScreenMode),
|
2020-02-24 23:32:46 +02:00
|
|
|
Handler: gui.prevScreenMode,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcPrevScreenMode,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 12:10:03 +02:00
|
|
|
ViewName: "status",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.OpenFile),
|
2018-09-01 12:10:03 +02:00
|
|
|
Handler: gui.handleOpenConfig,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.OpenConfig,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 12:10:03 +02:00
|
|
|
ViewName: "status",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Status.CheckForUpdate),
|
2018-09-01 12:10:03 +02:00
|
|
|
Handler: gui.handleCheckForUpdate,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCheckForUpdate,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-19 10:40:41 +02:00
|
|
|
ViewName: "status",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Status.RecentRepos),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleCreateRecentReposMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.SwitchRepo,
|
2018-09-19 10:40:41 +02:00
|
|
|
},
|
2020-11-27 09:07:14 +02:00
|
|
|
{
|
|
|
|
ViewName: "status",
|
|
|
|
Key: gui.getKey(config.Status.AllBranchesLogGraph),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleShowAllBranchLogs,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcAllBranchesLogGraph,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 14:20:45 +02:00
|
|
|
ViewName: "files",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.FILES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Files.ViewResetOptions),
|
2019-03-18 12:40:32 +02:00
|
|
|
Handler: gui.handleCreateResetMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcViewResetOptions,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-12-12 13:33:42 +02:00
|
|
|
ViewName: "files",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.FILES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Files.Fetch),
|
2018-12-12 13:33:42 +02:00
|
|
|
Handler: gui.handleGitFetch,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcFetch,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2020-09-19 12:55:52 +02:00
|
|
|
{
|
|
|
|
ViewName: "files",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.FILES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.CopyToClipboard),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCopyFileNameToClipboard,
|
2021-04-11 02:05:39 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
2018-09-03 18:44:56 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Select),
|
2018-09-03 18:44:56 +02:00
|
|
|
Handler: gui.handleBranchPress,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCheckout,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-10-12 14:06:03 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.CreatePullRequest),
|
2018-10-12 14:06:03 +02:00
|
|
|
Handler: gui.handleCreatePullRequestPress,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCreatePullRequest,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2021-04-21 13:23:36 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2021-04-21 13:23:36 +02:00
|
|
|
Key: gui.getKey(config.Branches.ViewPullRequestOptions),
|
|
|
|
Handler: gui.handleCreatePullRequestMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCreatePullRequestOptions,
|
2021-04-22 08:19:59 +02:00
|
|
|
OpensMenu: true,
|
2021-04-21 13:23:36 +02:00
|
|
|
},
|
2020-11-10 21:57:50 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-11-10 21:57:50 +02:00
|
|
|
Key: gui.getKey(config.Branches.CopyPullRequestURL),
|
|
|
|
Handler: gui.handleCopyPullRequestURLPress,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCopyPullRequestURL,
|
2020-11-10 21:57:50 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
2018-09-01 14:20:45 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.CheckoutBranchByName),
|
2018-09-01 14:20:45 +02:00
|
|
|
Handler: gui.handleCheckoutByName,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCheckoutByName,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 14:20:45 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.ForceCheckoutBranch),
|
2018-09-01 14:20:45 +02:00
|
|
|
Handler: gui.handleForceCheckout,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcForceCheckout,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 14:20:45 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.New),
|
2022-01-30 11:03:08 +02:00
|
|
|
Handler: gui.handleNewBranchOffBranch,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcNewBranch,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 14:20:45 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Remove),
|
2018-09-01 14:20:45 +02:00
|
|
|
Handler: gui.handleDeleteBranch,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcDeleteBranch,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-11-29 18:57:51 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.RebaseBranch),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: guards.OutsideFilterMode(gui.handleRebaseOntoLocalBranch),
|
|
|
|
Description: gui.c.Tr.LcRebaseBranch,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 14:20:45 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.MergeIntoCurrentBranch),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: guards.OutsideFilterMode(gui.handleMerge),
|
|
|
|
Description: gui.c.Tr.LcMergeIntoCurrentBranch,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2020-01-07 12:42:33 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.ViewGitFlowOptions),
|
2020-01-07 12:42:33 +02:00
|
|
|
Handler: gui.handleCreateGitFlowMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcGitFlowOptions,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2020-01-07 12:42:33 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
2018-12-07 09:52:31 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.FastForward),
|
2018-12-07 09:52:31 +02:00
|
|
|
Handler: gui.handleFastForward,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.FastForward,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2020-02-16 00:03:26 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.ViewResetOptions),
|
2020-02-16 00:03:26 +02:00
|
|
|
Handler: gui.handleCreateResetToBranchMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcViewResetOptions,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2020-02-16 00:03:26 +02:00
|
|
|
},
|
2020-03-17 12:22:07 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.RenameBranch),
|
2020-03-17 12:22:07 +02:00
|
|
|
Handler: gui.handleRenameBranch,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcRenameBranch,
|
2020-03-17 12:22:07 +02:00
|
|
|
},
|
2020-04-15 12:30:24 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.LOCAL_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.CopyToClipboard),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCopyBranchNameToClipboard,
|
2020-04-15 12:30:24 +02:00
|
|
|
},
|
2019-11-16 08:35:59 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Return),
|
2019-11-16 08:35:59 +02:00
|
|
|
Handler: gui.handleRemoteBranchesEscape,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ReturnToRemotesList,
|
2019-11-16 08:35:59 +02:00
|
|
|
},
|
2020-02-16 00:05:15 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.ViewResetOptions),
|
2020-02-16 00:05:15 +02:00
|
|
|
Handler: gui.handleCreateResetToRemoteBranchMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcViewResetOptions,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2020-02-16 00:05:15 +02:00
|
|
|
},
|
2020-04-15 12:30:24 +02:00
|
|
|
{
|
|
|
|
ViewName: "commits",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.BRANCH_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.CopyToClipboard),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCopyCommitShaToClipboard,
|
2020-04-15 12:30:24 +02:00
|
|
|
},
|
2020-03-18 23:45:21 +02:00
|
|
|
{
|
|
|
|
ViewName: "commits",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.BRANCH_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.ResetCherryPick),
|
2022-01-31 13:11:34 +02:00
|
|
|
Handler: gui.helpers.CherryPick.Reset,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcResetCherryPick,
|
2022-01-19 09:32:27 +02:00
|
|
|
},
|
2020-08-21 01:12:45 +02:00
|
|
|
{
|
|
|
|
ViewName: "commits",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.GoInto),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleViewReflogCommitFiles,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcViewCommitFiles,
|
2020-08-21 01:12:45 +02:00
|
|
|
},
|
2020-01-09 13:08:28 +02:00
|
|
|
{
|
|
|
|
ViewName: "commits",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Select),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: gui.CheckoutReflogCommit,
|
|
|
|
Description: gui.c.Tr.LcCheckoutCommit,
|
2020-01-09 13:08:28 +02:00
|
|
|
},
|
2020-01-09 13:23:28 +02:00
|
|
|
{
|
|
|
|
ViewName: "commits",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.ViewResetOptions),
|
2020-01-09 13:23:28 +02:00
|
|
|
Handler: gui.handleCreateReflogResetMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcViewResetOptions,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2020-01-09 13:23:28 +02:00
|
|
|
},
|
2020-08-22 03:57:44 +02:00
|
|
|
{
|
|
|
|
ViewName: "commits",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.CherryPickCopy),
|
2022-01-30 11:03:08 +02:00
|
|
|
Handler: guards.OutsideFilterMode(gui.handleCopyReflogCommit),
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCherryPickCopy,
|
2020-08-22 03:57:44 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "commits",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.CherryPickCopyRange),
|
2022-01-30 11:03:08 +02:00
|
|
|
Handler: guards.OutsideFilterMode(gui.handleCopyReflogCommitRange),
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCherryPickCopyRange,
|
2020-08-22 03:57:44 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "commits",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.ResetCherryPick),
|
2022-01-31 13:11:34 +02:00
|
|
|
Handler: gui.helpers.CherryPick.Reset,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcResetCherryPick,
|
2020-08-22 03:57:44 +02:00
|
|
|
},
|
2020-08-22 04:07:03 +02:00
|
|
|
{
|
|
|
|
ViewName: "commits",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REFLOG_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.CopyToClipboard),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCopyCommitShaToClipboard,
|
2020-09-19 12:55:52 +02:00
|
|
|
},
|
2020-08-22 00:49:02 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.GoInto),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleViewSubCommitFiles,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcViewCommitFiles,
|
2020-08-22 00:49:02 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Select),
|
2020-08-22 00:49:02 +02:00
|
|
|
Handler: gui.handleCheckoutSubCommit,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCheckoutCommit,
|
2020-08-22 00:49:02 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.ViewResetOptions),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleCreateSubCommitResetMenu,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcViewResetOptions,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2020-08-22 00:49:02 +02:00
|
|
|
},
|
2020-08-22 01:55:49 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.New),
|
2022-01-30 11:03:08 +02:00
|
|
|
Handler: gui.handleNewBranchOffSubCommit,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcNewBranch,
|
2020-08-22 01:55:49 +02:00
|
|
|
},
|
2020-08-22 03:05:37 +02:00
|
|
|
{
|
2020-08-22 03:44:03 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.CherryPickCopy),
|
2022-01-30 11:03:08 +02:00
|
|
|
Handler: gui.handleCopySubCommit,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCherryPickCopy,
|
2020-08-22 03:05:37 +02:00
|
|
|
},
|
2020-08-22 03:57:44 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.CherryPickCopyRange),
|
2022-01-30 11:03:08 +02:00
|
|
|
Handler: gui.handleCopySubCommitRange,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCherryPickCopyRange,
|
2020-08-22 03:57:44 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Commits.ResetCherryPick),
|
2022-01-31 13:11:34 +02:00
|
|
|
Handler: gui.helpers.CherryPick.Reset,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcResetCherryPick,
|
2020-08-22 03:57:44 +02:00
|
|
|
},
|
2020-08-22 04:07:03 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.SUB_COMMITS_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.CopyToClipboard),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCopyCommitShaToClipboard,
|
2020-08-22 04:07:03 +02:00
|
|
|
},
|
2020-08-21 11:53:45 +02:00
|
|
|
{
|
|
|
|
ViewName: "stash",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.GoInto),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleViewStashFiles,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcViewStashFiles,
|
2020-08-21 11:53:45 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
2018-09-01 14:20:45 +02:00
|
|
|
ViewName: "stash",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Select),
|
2018-09-01 14:20:45 +02:00
|
|
|
Handler: gui.handleStashApply,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcApply,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 14:20:45 +02:00
|
|
|
ViewName: "stash",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Stash.PopStash),
|
2018-09-01 14:20:45 +02:00
|
|
|
Handler: gui.handleStashPop,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcPop,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2018-09-01 14:20:45 +02:00
|
|
|
ViewName: "stash",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Remove),
|
2018-09-01 14:20:45 +02:00
|
|
|
Handler: gui.handleStashDrop,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcDrop,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2020-08-22 02:08:44 +02:00
|
|
|
{
|
|
|
|
ViewName: "stash",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.New),
|
2022-01-30 11:03:08 +02:00
|
|
|
Handler: gui.handleNewBranchOffStashEntry,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcNewBranch,
|
2020-08-22 02:08:44 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
2018-09-01 12:10:03 +02:00
|
|
|
ViewName: "commitMessage",
|
2020-10-12 23:16:24 +02:00
|
|
|
Key: gui.getKey(config.Universal.SubmitEditorText),
|
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-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.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-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.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-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.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",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Return),
|
2020-03-12 07:26:11 +02:00
|
|
|
Handler: gui.handleMenuClose,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCloseMenu,
|
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
|
|
|
},
|
2021-03-31 14:20:36 +02:00
|
|
|
{
|
|
|
|
ViewName: "commitFiles",
|
|
|
|
Key: gui.getKey(config.Universal.CopyToClipboard),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCopyCommitFileNameToClipboard,
|
2021-03-31 14:20:36 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
2019-03-11 00:28:47 +02:00
|
|
|
ViewName: "commitFiles",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.CommitFiles.CheckoutCommitFile),
|
2019-03-11 00:53:46 +02:00
|
|
|
Handler: gui.handleCheckoutCommitFile,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCheckoutCommitFile,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
2019-03-11 04:04:08 +02:00
|
|
|
ViewName: "commitFiles",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Remove),
|
2019-03-11 04:04:08 +02:00
|
|
|
Handler: gui.handleDiscardOldFileChange,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcDiscardOldFileChange,
|
2018-09-01 12:10:03 +02:00
|
|
|
},
|
2019-03-15 04:29:27 +02:00
|
|
|
{
|
|
|
|
ViewName: "commitFiles",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.OpenFile),
|
2019-03-15 04:29:27 +02:00
|
|
|
Handler: gui.handleOpenOldCommitFile,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcOpenFile,
|
2019-03-15 04:29:27 +02:00
|
|
|
},
|
2019-11-04 10:47:25 +02:00
|
|
|
{
|
|
|
|
ViewName: "commitFiles",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Edit),
|
2020-07-21 10:12:05 +02:00
|
|
|
Handler: gui.handleEditCommitFile,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcEditFile,
|
2020-07-21 10:12:05 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "commitFiles",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Select),
|
2019-11-04 10:47:25 +02:00
|
|
|
Handler: gui.handleToggleFileForPatch,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcToggleAddToPatch,
|
2019-11-04 10:47:25 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "commitFiles",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.GoInto),
|
2019-11-04 10:47:25 +02:00
|
|
|
Handler: gui.handleEnterCommitFile,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcEnterFile,
|
2019-11-04 10:47:25 +02:00
|
|
|
},
|
2021-03-31 14:20:36 +02:00
|
|
|
{
|
|
|
|
ViewName: "commitFiles",
|
|
|
|
Key: gui.getKey(config.Files.ToggleTreeView),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleToggleCommitFileTreeView,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcToggleTreeView,
|
2021-03-31 14:20:36 +02:00
|
|
|
},
|
2020-03-28 07:28:35 +02:00
|
|
|
{
|
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.FilteringMenu),
|
2020-03-29 05:34:17 +02:00
|
|
|
Handler: gui.handleCreateFilteringMenuPanel,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcOpenFilteringMenu,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2020-03-28 07:28:35 +02:00
|
|
|
},
|
2020-03-29 05:34:17 +02:00
|
|
|
{
|
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.DiffingMenu),
|
2020-03-29 05:34:17 +02:00
|
|
|
Handler: gui.handleCreateDiffingMenuPanel,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcOpenDiffingMenu,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2020-03-29 05:34:17 +02:00
|
|
|
},
|
2020-08-25 01:07:16 +02:00
|
|
|
{
|
|
|
|
ViewName: "",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.DiffingMenuAlt),
|
2020-08-25 01:07:16 +02:00
|
|
|
Handler: gui.handleCreateDiffingMenuPanel,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcOpenDiffingMenu,
|
2021-02-12 05:51:57 +02:00
|
|
|
OpensMenu: true,
|
2020-08-25 01:07:16 +02:00
|
|
|
},
|
2021-04-11 04:12:54 +02:00
|
|
|
{
|
|
|
|
ViewName: "",
|
|
|
|
Key: gui.getKey(config.Universal.ExtrasMenu),
|
|
|
|
Handler: gui.handleCreateExtrasMenuPanel,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcOpenExtrasMenu,
|
2021-04-11 04:12:54 +02:00
|
|
|
OpensMenu: true,
|
|
|
|
},
|
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: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_NORMAL_CONTEXT_KEY)},
|
2019-11-16 03:41:04 +02:00
|
|
|
Key: gocui.MouseWheelDown,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollDownMain,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ScrollDown,
|
2019-11-16 03:41:04 +02:00
|
|
|
Alternative: "fn+up",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_NORMAL_CONTEXT_KEY)},
|
2019-11-16 03:41:04 +02:00
|
|
|
Key: gocui.MouseWheelUp,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollUpMain,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ScrollUp,
|
2019-11-16 03:41:04 +02:00
|
|
|
Alternative: "fn+down",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_NORMAL_CONTEXT_KEY)},
|
2019-11-16 03:41:04 +02:00
|
|
|
Key: gocui.MouseLeft,
|
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.handleMouseDownMain,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "secondary",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2019-11-16 03:41:04 +02:00
|
|
|
Key: gocui.MouseLeft,
|
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.handleTogglePanelClick,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Return),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleStagingEscape,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ReturnToFilesPanel,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Select),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleToggleStagedSelection,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.StageSelection,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Remove),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleResetSelection,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ResetSelection,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.TogglePanel),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleTogglePanel,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.TogglePanel,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Return),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleEscapePatchBuildingPanel,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ExitLineByLineMode,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2020-08-15 02:58:29 +02:00
|
|
|
{
|
2020-08-15 03:23:14 +02:00
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.OpenFile),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleOpenFileAtLine,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcOpenFile,
|
2020-08-15 02:58:29 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevItem),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectPrevLine,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.PrevLine,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextItem),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectNextLine,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.NextLine,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevItemAlt),
|
2019-11-16 03:41:04 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectPrevLine,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextItemAlt),
|
2019-11-16 03:41:04 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectNextLine,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2019-11-16 03:41:04 +02:00
|
|
|
Key: gocui.MouseWheelUp,
|
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollUpMain,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2019-11-16 03:41:04 +02:00
|
|
|
Key: gocui.MouseWheelDown,
|
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollDownMain,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevBlock),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectPrevHunk,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.PrevHunk,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevBlockAlt),
|
2019-11-16 03:41:04 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectPrevHunk,
|
2020-10-01 23:56:14 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-01 23:56:14 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextBlock),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectNextHunk,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.NextHunk,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextBlockAlt),
|
2019-11-16 03:41:04 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectNextHunk,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2021-10-02 09:50:26 +02:00
|
|
|
{
|
2021-10-16 04:49:40 +02:00
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2021-10-16 04:49:40 +02:00
|
|
|
Key: gui.getKey(config.Universal.CopyToClipboard),
|
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.copySelectedToClipboard,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCopySelectedTexToClipboard,
|
2021-10-02 09:50:26 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Edit),
|
2021-08-03 14:38:03 +02:00
|
|
|
Handler: gui.handleLineByLineEdit,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcEditFile,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.OpenFile),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: gui.Controllers.Files.Open,
|
|
|
|
Description: gui.c.Tr.LcOpenFile,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2020-10-01 23:56:14 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-01 23:56:14 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextPage),
|
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleLineByLineNextPage,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcNextPage,
|
2020-10-01 23:56:14 +02:00
|
|
|
Tag: "navigation",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-01 23:56:14 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevPage),
|
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleLineByLinePrevPage,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcPrevPage,
|
2020-10-01 23:56:14 +02:00
|
|
|
Tag: "navigation",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-01 23:56:14 +02:00
|
|
|
Key: gui.getKey(config.Universal.GotoTop),
|
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleLineByLineGotoTop,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcGotoTop,
|
2020-10-01 23:56:14 +02:00
|
|
|
Tag: "navigation",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-01 23:56:14 +02:00
|
|
|
Key: gui.getKey(config.Universal.GotoBottom),
|
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleLineByLineGotoBottom,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcGotoBottom,
|
2020-10-01 23:56:14 +02:00
|
|
|
Tag: "navigation",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-01 23:56:14 +02:00
|
|
|
Key: gui.getKey(config.Universal.StartSearch),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: func() error { return gui.handleOpenSearch("main") },
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcStartSearch,
|
2020-10-01 23:56:14 +02:00
|
|
|
Tag: "navigation",
|
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Select),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleToggleSelectionForPatch,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ToggleSelectionForPatch,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Main.ToggleDragSelect),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleToggleSelectRange,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ToggleDragSelect,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2019-11-27 21:35:41 +02:00
|
|
|
// Alias 'V' -> 'v'
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Main.ToggleDragSelectAlt),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleToggleSelectRange,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ToggleDragSelect,
|
2019-11-27 21:35:41 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Main.ToggleSelectHunk),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleToggleSelectHunk,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ToggleSelectHunk,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2019-11-16 03:41:04 +02:00
|
|
|
Key: gocui.MouseLeft,
|
|
|
|
Modifier: gocui.ModNone,
|
2020-10-01 23:56:14 +02:00
|
|
|
Handler: gui.handleLBLMouseDown,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2021-02-09 12:49:03 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2021-02-09 12:49:03 +02:00
|
|
|
Key: gocui.MouseLeft,
|
|
|
|
Modifier: gocui.ModMotion,
|
|
|
|
Handler: gui.handleMouseDrag,
|
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2019-11-16 03:41:04 +02:00
|
|
|
Key: gocui.MouseWheelUp,
|
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollUpMain,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2019-11-16 03:41:04 +02:00
|
|
|
Key: gocui.MouseWheelDown,
|
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.scrollDownMain,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2021-11-02 11:35:53 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY), string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2021-11-02 11:35:53 +02:00
|
|
|
Key: gui.getKey(config.Universal.ScrollLeft),
|
|
|
|
Handler: gui.scrollLeftMain,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcScrollLeft,
|
2021-11-02 11:35:53 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_PATCH_BUILDING_CONTEXT_KEY), string(context.MAIN_STAGING_CONTEXT_KEY), string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2021-11-02 11:35:53 +02:00
|
|
|
Key: gui.getKey(config.Universal.ScrollRight),
|
|
|
|
Handler: gui.scrollRightMain,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcScrollRight,
|
2021-11-02 11:35:53 +02:00
|
|
|
},
|
2020-02-03 15:18:03 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Files.CommitChanges),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: gui.Controllers.Files.HandleCommitPress,
|
|
|
|
Description: gui.c.Tr.CommitChanges,
|
2020-02-03 15:18:03 +02:00
|
|
|
},
|
2020-02-04 13:43:56 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Files.CommitChangesWithoutHook),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: gui.Controllers.Files.HandleWIPCommitPress,
|
|
|
|
Description: gui.c.Tr.LcCommitChangesWithoutHook,
|
2020-02-04 13:43:56 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_STAGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Files.CommitChangesWithEditor),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: gui.Controllers.Files.HandleCommitEditorPress,
|
|
|
|
Description: gui.c.Tr.CommitChangesWithEditor,
|
2020-02-04 13:43:56 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Return),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleEscapeMerge,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ReturnToFilesPanel,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
2021-04-11 02:05:39 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2021-04-11 02:05:39 +02:00
|
|
|
Key: gui.getKey(config.Files.OpenMergeTool),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: gui.Controllers.Files.OpenMergeTool,
|
|
|
|
Description: gui.c.Tr.LcOpenMergeTool,
|
2021-04-11 02:05:39 +02:00
|
|
|
},
|
2019-11-16 03:41:04 +02:00
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Select),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handlePickHunk,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.PickHunk,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Main.PickBothHunks),
|
2021-08-24 14:38:34 +02:00
|
|
|
Handler: gui.handlePickAllHunks,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.PickAllHunks,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevBlock),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectPrevConflict,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.PrevConflict,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextBlock),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectNextConflict,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.NextConflict,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevItem),
|
2021-08-21 18:03:05 +02:00
|
|
|
Handler: gui.handleSelectPrevConflictHunk,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.SelectPrevHunk,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextItem),
|
2021-08-21 18:03:05 +02:00
|
|
|
Handler: gui.handleSelectNextConflictHunk,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.SelectNextHunk,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevBlockAlt),
|
2019-11-16 03:41:04 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectPrevConflict,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextBlockAlt),
|
2019-11-16 03:41:04 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleSelectNextConflict,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevItemAlt),
|
2019-11-16 03:41:04 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-08-21 18:03:05 +02:00
|
|
|
Handler: gui.handleSelectPrevConflictHunk,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextItemAlt),
|
2019-11-16 03:41:04 +02:00
|
|
|
Modifier: gocui.ModNone,
|
2021-08-21 18:03:05 +02:00
|
|
|
Handler: gui.handleSelectNextConflictHunk,
|
2019-11-16 03:41:04 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "main",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.MAIN_MERGING_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Undo),
|
2022-01-25 16:20:19 +02:00
|
|
|
Handler: gui.handleMergeConflictUndo,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcUndo,
|
2019-11-17 09:15:32 +02:00
|
|
|
},
|
2019-11-17 03:07:36 +02:00
|
|
|
{
|
2020-08-25 11:24:14 +02:00
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Select),
|
2020-08-25 11:24:14 +02:00
|
|
|
// gonna use the exact same handler as the 'n' keybinding because everybody wants this to happen when they checkout a remote branch
|
2022-01-30 11:03:08 +02:00
|
|
|
Handler: gui.handleNewBranchOffRemoteBranch,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCheckout,
|
2019-11-17 03:07:36 +02:00
|
|
|
},
|
2020-05-18 13:04:50 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.New),
|
2022-01-30 11:03:08 +02:00
|
|
|
Handler: gui.handleNewBranchOffRemoteBranch,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcNewBranch,
|
2020-05-18 13:04:50 +02:00
|
|
|
},
|
2019-11-17 04:21:38 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.MergeIntoCurrentBranch),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: guards.OutsideFilterMode(gui.handleMergeRemoteBranch),
|
|
|
|
Description: gui.c.Tr.LcMergeIntoCurrentBranch,
|
2019-11-17 04:21:38 +02:00
|
|
|
},
|
2019-11-17 04:47:47 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Remove),
|
2019-11-17 04:47:47 +02:00
|
|
|
Handler: gui.handleDeleteRemoteBranch,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcDeleteBranch,
|
2019-11-17 04:47:47 +02:00
|
|
|
},
|
2019-11-17 05:04:57 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.RebaseBranch),
|
2022-01-16 05:46:53 +02:00
|
|
|
Handler: guards.OutsideFilterMode(gui.handleRebaseOntoRemoteBranch),
|
|
|
|
Description: gui.c.Tr.LcRebaseBranch,
|
2019-11-17 05:04:57 +02:00
|
|
|
},
|
2019-11-17 05:50:12 +02:00
|
|
|
{
|
|
|
|
ViewName: "branches",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.REMOTE_BRANCHES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Branches.SetUpstream),
|
2019-11-17 05:50:12 +02:00
|
|
|
Handler: gui.handleSetBranchUpstream,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcSetUpstream,
|
2019-11-17 05:50:12 +02:00
|
|
|
},
|
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-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Confirm),
|
2020-02-23 12:53:30 +02:00
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.handleSearch,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "search",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.Return),
|
2020-02-23 12:53:30 +02:00
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.handleSearchEscape,
|
|
|
|
},
|
2020-03-26 12:39:59 +02:00
|
|
|
{
|
|
|
|
ViewName: "confirmation",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevItem),
|
2020-03-26 12:39:59 +02:00
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.scrollUpConfirmationPanel,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "confirmation",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextItem),
|
2020-03-26 12:39:59 +02:00
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.scrollDownConfirmationPanel,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "confirmation",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevItemAlt),
|
2020-03-26 12:39:59 +02:00
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.scrollUpConfirmationPanel,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "confirmation",
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextItemAlt),
|
2020-03-26 12:39:59 +02:00
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.scrollDownConfirmationPanel,
|
|
|
|
},
|
2020-09-30 00:27:23 +02:00
|
|
|
{
|
|
|
|
ViewName: "files",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.SUBMODULES_CONTEXT_KEY)},
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.CopyToClipboard),
|
2021-04-02 10:20:40 +02:00
|
|
|
Handler: gui.handleCopySelectedSideContextItemToClipboard,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcCopySubmoduleNameToClipboard,
|
2020-09-30 00:27:23 +02:00
|
|
|
},
|
2021-05-28 12:02:19 +02:00
|
|
|
{
|
2021-05-28 13:32:55 +02:00
|
|
|
ViewName: "files",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.FILES_CONTEXT_KEY)},
|
2021-05-28 13:32:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.ToggleWhitespaceInDiffView),
|
|
|
|
Handler: gui.toggleWhitespaceInDiffView,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.ToggleWhitespaceInDiffView,
|
2021-05-28 12:02:19 +02:00
|
|
|
},
|
2021-09-11 20:42:23 +02:00
|
|
|
{
|
|
|
|
ViewName: "",
|
|
|
|
Key: gui.getKey(config.Universal.IncreaseContextInDiffView),
|
|
|
|
Handler: gui.IncreaseContextInDiffView,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.IncreaseContextInDiffView,
|
2021-09-11 20:42:23 +02:00
|
|
|
},
|
2021-09-11 19:35:17 +02:00
|
|
|
{
|
|
|
|
ViewName: "",
|
|
|
|
Key: gui.getKey(config.Universal.DecreaseContextInDiffView),
|
|
|
|
Handler: gui.DecreaseContextInDiffView,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.DecreaseContextInDiffView,
|
2021-09-11 19:35:17 +02:00
|
|
|
},
|
2021-04-11 03:43:07 +02:00
|
|
|
{
|
|
|
|
ViewName: "extras",
|
|
|
|
Key: gocui.MouseWheelUp,
|
|
|
|
Handler: gui.scrollUpExtra,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "extras",
|
|
|
|
Key: gocui.MouseWheelDown,
|
|
|
|
Handler: gui.scrollDownExtra,
|
|
|
|
},
|
2021-04-11 07:01:49 +02:00
|
|
|
{
|
|
|
|
ViewName: "extras",
|
|
|
|
Key: gui.getKey(config.Universal.ExtrasMenu),
|
|
|
|
Handler: gui.handleCreateExtrasMenuPanel,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcOpenExtrasMenu,
|
2021-04-11 07:01:49 +02:00
|
|
|
OpensMenu: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "extras",
|
|
|
|
Tag: "navigation",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.COMMAND_LOG_CONTEXT_KEY)},
|
2021-04-11 07:01:49 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevItemAlt),
|
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.scrollUpExtra,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "extras",
|
|
|
|
Tag: "navigation",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.COMMAND_LOG_CONTEXT_KEY)},
|
2021-04-11 07:01:49 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevItem),
|
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.scrollUpExtra,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "extras",
|
|
|
|
Tag: "navigation",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.COMMAND_LOG_CONTEXT_KEY)},
|
2021-04-11 07:01:49 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextItem),
|
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.scrollDownExtra,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "extras",
|
|
|
|
Tag: "navigation",
|
2022-01-29 10:15:46 +02:00
|
|
|
Contexts: []string{string(context.COMMAND_LOG_CONTEXT_KEY)},
|
2021-04-11 07:01:49 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextItemAlt),
|
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.scrollDownExtra,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: "extras",
|
|
|
|
Tag: "navigation",
|
|
|
|
Key: gocui.MouseLeft,
|
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.handleFocusCommandLog,
|
|
|
|
},
|
2018-08-08 11:18:41 +02:00
|
|
|
}
|
2018-08-09 15:26:31 +02:00
|
|
|
|
2022-02-05 01:31:07 +02:00
|
|
|
keybindingsOpts := types.KeybindingsOpts{
|
|
|
|
GetKey: gui.getKey,
|
|
|
|
Config: config,
|
|
|
|
Guards: guards,
|
|
|
|
}
|
|
|
|
|
2022-02-05 05:42:56 +02:00
|
|
|
mouseKeybindings := []*gocui.ViewMouseBinding{}
|
2022-02-05 07:56:36 +02:00
|
|
|
for _, c := range gui.State.Contexts.Flatten() {
|
2022-02-05 05:42:56 +02:00
|
|
|
viewName := c.GetViewName()
|
|
|
|
contextKey := c.GetKey()
|
|
|
|
for _, binding := range c.GetKeybindings(keybindingsOpts) {
|
|
|
|
// TODO: move all mouse keybindings into the mouse keybindings approach below
|
|
|
|
if !gocui.IsMouseKey(binding.Key) && contextKey != context.GLOBAL_CONTEXT_KEY {
|
|
|
|
binding.Contexts = []string{string(contextKey)}
|
|
|
|
}
|
2022-01-16 05:46:53 +02:00
|
|
|
binding.ViewName = viewName
|
|
|
|
bindings = append(bindings, binding)
|
|
|
|
}
|
2022-01-28 11:44:36 +02:00
|
|
|
|
2022-02-05 05:42:56 +02:00
|
|
|
for _, binding := range c.GetMouseKeybindings(keybindingsOpts) {
|
|
|
|
if contextKey != context.GLOBAL_CONTEXT_KEY {
|
|
|
|
binding.FromContext = string(contextKey)
|
|
|
|
}
|
|
|
|
mouseKeybindings = append(mouseKeybindings, binding)
|
2022-01-28 11:44:36 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-11 04:04:08 +02:00
|
|
|
for _, viewName := range []string{"status", "branches", "files", "commits", "commitFiles", "stash", "menu"} {
|
2022-01-28 11:44:36 +02:00
|
|
|
bindings = append(bindings, []*types.Binding{
|
2021-04-02 10:20:40 +02:00
|
|
|
{ViewName: viewName, Key: gui.getKey(config.Universal.PrevBlock), Modifier: gocui.ModNone, Handler: gui.previousSideWindow},
|
|
|
|
{ViewName: viewName, Key: gui.getKey(config.Universal.NextBlock), Modifier: gocui.ModNone, Handler: gui.nextSideWindow},
|
|
|
|
{ViewName: viewName, Key: gui.getKey(config.Universal.PrevBlockAlt), Modifier: gocui.ModNone, Handler: gui.previousSideWindow},
|
|
|
|
{ViewName: viewName, Key: gui.getKey(config.Universal.NextBlockAlt), Modifier: gocui.ModNone, Handler: gui.nextSideWindow},
|
2021-04-11 15:32:20 +02:00
|
|
|
{ViewName: viewName, Key: gui.getKey(config.Universal.PrevBlockAlt2), Modifier: gocui.ModNone, Handler: gui.previousSideWindow},
|
|
|
|
{ViewName: viewName, Key: gui.getKey(config.Universal.NextBlockAlt2), Modifier: gocui.ModNone, Handler: 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
|
2021-10-18 11:06:03 +02:00
|
|
|
windows := []string{"status", "files", "branches", "commits", "stash"}
|
|
|
|
|
|
|
|
if len(config.Universal.JumpToBlock) != len(windows) {
|
2021-10-17 19:22:59 +02:00
|
|
|
log.Fatal("Jump to block keybindings cannot be set. Exactly 5 keybindings must be supplied.")
|
|
|
|
} else {
|
2021-10-18 11:06:03 +02:00
|
|
|
for i, window := range windows {
|
2022-01-28 11:44:36 +02:00
|
|
|
bindings = append(bindings, &types.Binding{
|
2021-10-17 19:22:59 +02:00
|
|
|
ViewName: "",
|
|
|
|
Key: gui.getKey(config.Universal.JumpToBlock[i]),
|
|
|
|
Modifier: gocui.ModNone,
|
|
|
|
Handler: gui.goToSideWindow(window)})
|
|
|
|
}
|
2019-07-27 13:16:26 +02:00
|
|
|
}
|
|
|
|
|
2022-01-16 05:46:53 +02:00
|
|
|
for viewName := range gui.State.Contexts.InitialViewTabContextMap() {
|
2022-01-28 11:44:36 +02:00
|
|
|
bindings = append(bindings, []*types.Binding{
|
2020-10-01 23:32:48 +02:00
|
|
|
{
|
|
|
|
ViewName: viewName,
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.NextTab),
|
2020-10-01 23:32:48 +02:00
|
|
|
Handler: gui.handleNextTab,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcNextTab,
|
2020-10-01 23:32:48 +02:00
|
|
|
Tag: "navigation",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
ViewName: viewName,
|
2020-10-03 06:54:55 +02:00
|
|
|
Key: gui.getKey(config.Universal.PrevTab),
|
2020-10-01 23:32:48 +02:00
|
|
|
Handler: gui.handlePrevTab,
|
2022-01-16 05:46:53 +02:00
|
|
|
Description: gui.c.Tr.LcPrevTab,
|
2020-10-01 23:32:48 +02:00
|
|
|
Tag: "navigation",
|
|
|
|
},
|
|
|
|
}...)
|
|
|
|
}
|
|
|
|
|
2022-02-05 05:42:56 +02:00
|
|
|
return bindings, mouseKeybindings
|
2018-08-28 20:07:13 +02:00
|
|
|
}
|
|
|
|
|
2022-01-31 13:11:34 +02:00
|
|
|
func (gui *Gui) resetKeybindings() error {
|
|
|
|
gui.g.DeleteAllKeybindings()
|
|
|
|
|
2020-09-26 07:23:28 +02:00
|
|
|
bindings := gui.GetCustomCommandKeybindings()
|
|
|
|
|
2022-02-05 05:42:56 +02:00
|
|
|
bindings, mouseBindings := gui.GetInitialKeybindings()
|
|
|
|
|
|
|
|
// prepending because we want to give our custom keybindings precedence over default keybindings
|
|
|
|
bindings = append(gui.GetCustomCommandKeybindings(), bindings...)
|
2018-08-28 20:07:13 +02:00
|
|
|
|
2018-08-08 11:18:41 +02:00
|
|
|
for _, binding := range bindings {
|
2022-01-29 10:09:20 +02:00
|
|
|
if err := gui.SetKeybinding(binding); err != nil {
|
2018-08-08 11:18:41 +02:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
2019-11-13 14:18:31 +02:00
|
|
|
|
2022-02-05 05:42:56 +02:00
|
|
|
for _, binding := range mouseBindings {
|
|
|
|
if err := gui.SetMouseKeybinding(binding); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-16 05:46:53 +02:00
|
|
|
for viewName := range gui.State.Contexts.InitialViewTabContextMap() {
|
2020-10-02 12:05:45 +02:00
|
|
|
viewName := viewName
|
2020-09-30 00:27:12 +02:00
|
|
|
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
|
|
|
|
}
|
2022-01-29 10:09:20 +02:00
|
|
|
|
|
|
|
func (gui *Gui) wrappedHandler(f func() error) func(g *gocui.Gui, v *gocui.View) error {
|
|
|
|
return func(g *gocui.Gui, v *gocui.View) error {
|
|
|
|
return f()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (gui *Gui) SetKeybinding(binding *types.Binding) error {
|
|
|
|
handler := binding.Handler
|
2022-02-05 05:42:56 +02:00
|
|
|
// TODO: move all mouse-ey stuff into new mouse approach
|
|
|
|
if gocui.IsMouseKey(binding.Key) {
|
2022-01-29 10:09:20 +02:00
|
|
|
handler = func() error {
|
|
|
|
// we ignore click events on views that aren't popup panels, when a popup panel is focused
|
|
|
|
if gui.popupPanelFocused() && gui.currentViewName() != binding.ViewName {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return binding.Handler()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return gui.g.SetKeybinding(binding.ViewName, binding.Contexts, binding.Key, binding.Modifier, gui.wrappedHandler(handler))
|
|
|
|
}
|
|
|
|
|
2022-02-05 05:42:56 +02:00
|
|
|
// warning: mutates the binding
|
|
|
|
func (gui *Gui) SetMouseKeybinding(binding *gocui.ViewMouseBinding) error {
|
|
|
|
baseHandler := binding.Handler
|
|
|
|
newHandler := func(opts gocui.ViewMouseBindingOpts) error {
|
|
|
|
// we ignore click events on views that aren't popup panels, when a popup panel is focused
|
|
|
|
if gui.popupPanelFocused() && gui.currentViewName() != binding.ViewName {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return baseHandler(opts)
|
2022-01-30 11:34:59 +02:00
|
|
|
}
|
2022-02-05 05:42:56 +02:00
|
|
|
binding.Handler = newHandler
|
|
|
|
|
|
|
|
return gui.g.SetViewClickBinding(binding)
|
2022-01-29 10:09:20 +02:00
|
|
|
}
|