Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f05a5e531e | ||
|
|
68586ec49a | ||
|
|
6cf75af0af | ||
|
|
304607ae5d | ||
|
|
e9f28855a2 | ||
|
|
66d7d5f312 | ||
|
|
59734f1069 | ||
|
|
2974a57943 | ||
|
|
fcdcd1c335 | ||
|
|
4a35f9fcdb | ||
|
|
674b14802e |
6
.github/workflows/cd.yml
vendored
6
.github/workflows/cd.yml
vendored
@@ -21,12 +21,8 @@ jobs:
|
||||
uses: goreleaser/goreleaser-action@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_API_TOKEN}}
|
||||
- name: Get tag
|
||||
id: tag
|
||||
uses: dawidd6/action-get-tag@v1
|
||||
- name: Bump Homebrew
|
||||
uses: dawidd6/action-homebrew-bump-formula@v1
|
||||
uses: dawidd6/action-homebrew-bump-formula@v2
|
||||
with:
|
||||
token: ${{secrets.GITHUB_API_TOKEN}}
|
||||
formula: lazygit
|
||||
url: "https://github.com/${{github.repository}}/archive/${{steps.tag.outputs.tag}}.tar.gz"
|
||||
|
||||
@@ -28,6 +28,7 @@ Default path for the config file:
|
||||
show: true
|
||||
mouseEvents: true
|
||||
skipUnstageLineWarning: false
|
||||
skipStashWarning: true
|
||||
git:
|
||||
paging:
|
||||
colorArg: always
|
||||
@@ -35,6 +36,8 @@ Default path for the config file:
|
||||
merging:
|
||||
# only applicable to unix users
|
||||
manualCommit: false
|
||||
# extra args passed to `git merge`, e.g. --no-ff
|
||||
args: ""
|
||||
skipHookPrefix: WIP
|
||||
autoFetch: true
|
||||
update:
|
||||
@@ -91,6 +94,7 @@ Default path for the config file:
|
||||
redo: '<c-z>'
|
||||
filteringMenu: <c-s>
|
||||
diffingMenu: '<c-e>'
|
||||
copyToClipboard: '<c-o>'
|
||||
status:
|
||||
checkForUpdate: 'u'
|
||||
recentRepos: '<enter>'
|
||||
@@ -220,7 +224,7 @@ If you have issues with a light terminal theme where you can't read / see the te
|
||||
|
||||
## Keybindings
|
||||
|
||||
For all possible keybinding options, check [Custom_Keybinding.md](https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybinding.md)
|
||||
For all possible keybinding options, check [Custom_Keybindings.md](https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md)
|
||||
|
||||
### Example Keybindings For Colemak Users
|
||||
|
||||
@@ -266,3 +270,19 @@ Where:
|
||||
- `gitDomain` stands for the domain used by git itself (i.e. the one present on clone URLs), e.g. `git.work.com`
|
||||
- `provider` is one of `github`, `bitbucket` or `gitlab`
|
||||
- `webDomain` is the URL where your git service exposes a web interface and APIs, e.g. `gitservice.work.com`
|
||||
|
||||
## Predefined commit message prefix
|
||||
In situations where certain naming pattern is used for branches and commits, pattern can be used to populate
|
||||
commit message with prefix that is parsed from the branch name.
|
||||
|
||||
Example:
|
||||
* Branch name: feature/AB-123
|
||||
* Commit message: [AB-123] Adding feature
|
||||
|
||||
```yaml
|
||||
git:
|
||||
commitPrefixes:
|
||||
my_project: # This is repository folder name
|
||||
pattern: "^\\w+\\/(\\w+-\\w+)"
|
||||
replace: "[$1] "
|
||||
```
|
||||
|
||||
@@ -109,11 +109,12 @@ func (c *CommitListBuilder) GetCommits(options GetCommitsOptions) ([]*Commit, er
|
||||
cmd := c.getLogCmd(options)
|
||||
|
||||
err = RunLineOutputCmd(cmd, func(line string) (bool, error) {
|
||||
commit := c.extractCommitFromLine(line)
|
||||
_, unpushed := unpushedCommits[commit.ShortSha()]
|
||||
commit.Status = map[bool]string{true: "unpushed", false: "pushed"}[unpushed]
|
||||
commits = append(commits, commit)
|
||||
|
||||
if strings.Split(line, " ")[0] != "gpg:" {
|
||||
commit := c.extractCommitFromLine(line)
|
||||
_, unpushed := unpushedCommits[commit.ShortSha()]
|
||||
commit.Status = map[bool]string{true: "unpushed", false: "pushed"}[unpushed]
|
||||
commits = append(commits, commit)
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -410,7 +410,8 @@ func (c *GitCommand) ListStash() (string, error) {
|
||||
|
||||
// Merge merge
|
||||
func (c *GitCommand) Merge(branchName string) error {
|
||||
return c.OSCommand.RunCommand("git merge --no-edit %s", branchName)
|
||||
mergeArgs := c.Config.GetUserConfig().GetString("git.merging.args")
|
||||
return c.OSCommand.RunCommand("git merge --no-edit %s %s", mergeArgs, branchName)
|
||||
}
|
||||
|
||||
// AbortMerge abort merge
|
||||
|
||||
@@ -454,3 +454,14 @@ func RunLineOutputCmd(cmd *exec.Cmd, onLine func(line string) (bool, error)) err
|
||||
cmd.Wait()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *OSCommand) CopyToClipboard(str string) error {
|
||||
commandTemplate := c.Config.GetUserConfig().GetString("os.copyToClipboardCommand")
|
||||
templateValues := map[string]string{
|
||||
"str": c.Quote(str),
|
||||
}
|
||||
|
||||
command := utils.ResolvePlaceholderString(commandTemplate, templateValues)
|
||||
|
||||
return c.RunCommand(command)
|
||||
}
|
||||
|
||||
@@ -244,6 +244,7 @@ func GetDefaultConfig() []byte {
|
||||
scrollPastBottom: true
|
||||
mouseEvents: true
|
||||
skipUnstageLineWarning: false
|
||||
skipStashWarning: true
|
||||
sidePanelWidth: 0.3333
|
||||
theme:
|
||||
lightTheme: false
|
||||
@@ -264,6 +265,7 @@ git:
|
||||
useConfig: false
|
||||
merging:
|
||||
manualCommit: false
|
||||
args: ""
|
||||
skipHookPrefix: 'WIP'
|
||||
autoFetch: true
|
||||
update:
|
||||
@@ -322,6 +324,7 @@ keybinding:
|
||||
redo: '<c-z>'
|
||||
filteringMenu: <c-s>
|
||||
diffingMenu: '<c-e>'
|
||||
copyToClipboard: '<c-o>'
|
||||
status:
|
||||
checkForUpdate: 'u'
|
||||
recentRepos: '<enter>'
|
||||
|
||||
@@ -7,5 +7,6 @@ func GetPlatformDefaultConfig() []byte {
|
||||
return []byte(
|
||||
`os:
|
||||
openCommand: 'open {{filename}}'
|
||||
openLinkCommand: 'open {{link}}'`)
|
||||
openLinkCommand: 'open {{link}}'
|
||||
copyToClipboardCommand: 'bash -c "echo -n {{str}} | pbcopy"'`)
|
||||
}
|
||||
|
||||
@@ -5,5 +5,6 @@ func GetPlatformDefaultConfig() []byte {
|
||||
return []byte(
|
||||
`os:
|
||||
openCommand: 'sh -c "xdg-open {{filename}} >/dev/null"'
|
||||
openLinkCommand: 'sh -c "xdg-open {{link}} >/dev/null"'`)
|
||||
openLinkCommand: 'sh -c "xdg-open {{link}} >/dev/null"'
|
||||
copyToClipboardCommand: 'bash -c "echo -n {{str}} | xclip -selection clipboard"'`)
|
||||
}
|
||||
|
||||
@@ -5,5 +5,6 @@ func GetPlatformDefaultConfig() []byte {
|
||||
return []byte(
|
||||
`os:
|
||||
openCommand: 'cmd /c "start "" {{filename}}"'
|
||||
openLinkCommand: 'cmd /c "start "" {{link}}"'`)
|
||||
openLinkCommand: 'cmd /c "start "" {{link}}"'
|
||||
copyToClipboardCommand: 'cmd \c "echo -n {{str}} > /dev/clipboard"`)
|
||||
}
|
||||
|
||||
@@ -520,3 +520,12 @@ func (gui *Gui) currentBranch() *commands.Branch {
|
||||
}
|
||||
return gui.State.Branches[0]
|
||||
}
|
||||
|
||||
func (gui *Gui) handleClipboardCopyBranch(g *gocui.Gui, v *gocui.View) error {
|
||||
branch := gui.getSelectedBranch()
|
||||
if branch == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return gui.OSCommand.CopyToClipboard(branch.Name)
|
||||
}
|
||||
|
||||
@@ -703,3 +703,12 @@ func (gui *Gui) handleGotoBottomForCommitsPanel(g *gocui.Gui, v *gocui.View) err
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (gui *Gui) handleClipboardCopyCommit(g *gocui.Gui, v *gocui.View) error {
|
||||
commit := gui.getSelectedCommit()
|
||||
if commit == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return gui.OSCommand.CopyToClipboard(commit.Sha)
|
||||
}
|
||||
|
||||
@@ -8,11 +8,13 @@ import (
|
||||
// "strings"
|
||||
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/jesseduffield/gocui"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
)
|
||||
|
||||
// list panel functions
|
||||
@@ -286,6 +288,20 @@ func (gui *Gui) handleCommitPress(g *gocui.Gui, filesView *gocui.View) error {
|
||||
return gui.createErrorPanel(gui.Tr.SLocalize("NoStagedFilesToCommit"))
|
||||
}
|
||||
commitMessageView := gui.getCommitMessageView()
|
||||
prefixPattern := gui.Config.GetUserConfig().GetString("git.commitPrefixes." + utils.GetCurrentRepoName() + ".pattern")
|
||||
prefixReplace := gui.Config.GetUserConfig().GetString("git.commitPrefixes." + utils.GetCurrentRepoName() + ".replace")
|
||||
if len(prefixPattern) > 0 && len(prefixReplace) > 0 {
|
||||
rgx, err := regexp.Compile(prefixPattern)
|
||||
if err != nil {
|
||||
return gui.createErrorPanel(fmt.Sprintf("%s: %s", gui.Tr.SLocalize("commitPrefixPatternError"), err.Error()))
|
||||
}
|
||||
prefix := rgx.ReplaceAllString(gui.getCheckedOutBranch().Name, prefixReplace)
|
||||
gui.renderString(g, "commitMessage", prefix)
|
||||
if err := commitMessageView.SetCursor(len(prefix), 0); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
g.Update(func(g *gocui.Gui) error {
|
||||
if _, err := g.SetViewOnTop("commitMessage"); err != nil {
|
||||
return err
|
||||
|
||||
@@ -76,6 +76,10 @@ func (gui *Gui) handleCreateGitFlowMenu(g *gocui.Gui, v *gocui.View) error {
|
||||
displayString: "start hotfix",
|
||||
onPress: startHandler("hotfix"),
|
||||
},
|
||||
{
|
||||
displayString: "start bugfix",
|
||||
onPress: startHandler("bugfix"),
|
||||
},
|
||||
{
|
||||
displayString: "start release",
|
||||
onPress: startHandler("release"),
|
||||
|
||||
@@ -222,7 +222,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.scrollUpMain"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollUpMain,
|
||||
Alternative: "fn+up",
|
||||
Description: gui.Tr.SLocalize("scrollUpMainPanel"),
|
||||
@@ -230,7 +229,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.scrollDownMain"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollDownMain,
|
||||
Alternative: "fn+down",
|
||||
Description: gui.Tr.SLocalize("scrollDownMainPanel"),
|
||||
@@ -262,42 +260,36 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.createRebaseOptionsMenu"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateRebaseOptionsMenu,
|
||||
Description: gui.Tr.SLocalize("ViewMergeRebaseOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.createPatchOptionsMenu"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreatePatchOptionsMenu,
|
||||
Description: gui.Tr.SLocalize("ViewPatchOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.pushFiles"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.pushFiles,
|
||||
Description: gui.Tr.SLocalize("push"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.pullFiles"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handlePullFiles,
|
||||
Description: gui.Tr.SLocalize("pull"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.refresh"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleRefresh,
|
||||
Description: gui.Tr.SLocalize("refresh"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.optionMenu"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateOptionsMenu,
|
||||
Description: gui.Tr.SLocalize("openMenu"),
|
||||
},
|
||||
@@ -316,182 +308,156 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.undo"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.reflogUndo,
|
||||
Description: gui.Tr.SLocalize("undoReflog"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.redo"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.reflogRedo,
|
||||
Description: gui.Tr.SLocalize("redoReflog"),
|
||||
},
|
||||
{
|
||||
ViewName: "status",
|
||||
Key: gui.getKey("universal.edit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleEditConfig,
|
||||
Description: gui.Tr.SLocalize("EditConfig"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.nextScreenMode"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.nextScreenMode,
|
||||
Description: gui.Tr.SLocalize("nextScreenMode"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.prevScreenMode"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.prevScreenMode,
|
||||
Description: gui.Tr.SLocalize("prevScreenMode"),
|
||||
},
|
||||
{
|
||||
ViewName: "status",
|
||||
Key: gui.getKey("universal.openFile"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleOpenConfig,
|
||||
Description: gui.Tr.SLocalize("OpenConfig"),
|
||||
},
|
||||
{
|
||||
ViewName: "status",
|
||||
Key: gui.getKey("status.checkForUpdate"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCheckForUpdate,
|
||||
Description: gui.Tr.SLocalize("checkForUpdate"),
|
||||
},
|
||||
{
|
||||
ViewName: "status",
|
||||
Key: gui.getKey("status.recentRepos"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateRecentReposMenu,
|
||||
Description: gui.Tr.SLocalize("SwitchRepo"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.commitChanges"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitPress,
|
||||
Description: gui.Tr.SLocalize("CommitChanges"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.commitChangesWithoutHook"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleWIPCommitPress,
|
||||
Description: gui.Tr.SLocalize("commitChangesWithoutHook"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.amendLastCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleAmendCommitPress,
|
||||
Description: gui.Tr.SLocalize("AmendLastCommit"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.commitChangesWithEditor"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitEditorPress,
|
||||
Description: gui.Tr.SLocalize("CommitChangesWithEditor"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleFilePress,
|
||||
Description: gui.Tr.SLocalize("toggleStaged"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateDiscardMenu,
|
||||
Description: gui.Tr.SLocalize("viewDiscardOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("universal.edit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleFileEdit,
|
||||
Description: gui.Tr.SLocalize("editFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("universal.openFile"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleFileOpen,
|
||||
Description: gui.Tr.SLocalize("openFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.ignoreFile"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleIgnoreFile,
|
||||
Description: gui.Tr.SLocalize("ignoreFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.refreshFiles"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleRefreshFiles,
|
||||
Description: gui.Tr.SLocalize("refreshFiles"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.stashAllChanges"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleStashChanges,
|
||||
Description: gui.Tr.SLocalize("stashAllChanges"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.viewStashOptions"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateStashMenu,
|
||||
Description: gui.Tr.SLocalize("viewStashOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.toggleStagedAll"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleStageAll,
|
||||
Description: gui.Tr.SLocalize("toggleStagedAll"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.viewResetOptions"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateResetMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("universal.goInto"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleEnterFile,
|
||||
Description: gui.Tr.SLocalize("StageLines"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("files.fetch"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleGitFetch,
|
||||
Description: gui.Tr.SLocalize("fetch"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.executeCustomCommand"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCustomCommand,
|
||||
Description: gui.Tr.SLocalize("executeCustomCommand"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateResetToUpstreamMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetToUpstreamOptions"),
|
||||
},
|
||||
@@ -499,7 +465,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleBranchPress,
|
||||
Description: gui.Tr.SLocalize("checkout"),
|
||||
},
|
||||
@@ -507,7 +472,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("branches.createPullRequest"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreatePullRequestPress,
|
||||
Description: gui.Tr.SLocalize("createPullRequest"),
|
||||
},
|
||||
@@ -515,7 +479,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("branches.checkoutBranchByName"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCheckoutByName,
|
||||
Description: gui.Tr.SLocalize("checkoutByName"),
|
||||
},
|
||||
@@ -523,7 +486,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("branches.forceCheckoutBranch"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleForceCheckout,
|
||||
Description: gui.Tr.SLocalize("forceCheckout"),
|
||||
},
|
||||
@@ -531,7 +493,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("universal.new"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleNewBranch,
|
||||
Description: gui.Tr.SLocalize("newBranch"),
|
||||
},
|
||||
@@ -539,7 +500,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleDeleteBranch,
|
||||
Description: gui.Tr.SLocalize("deleteBranch"),
|
||||
},
|
||||
@@ -547,7 +507,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("branches.rebaseBranch"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleRebaseOntoLocalBranch,
|
||||
Description: gui.Tr.SLocalize("rebaseBranch"),
|
||||
},
|
||||
@@ -555,7 +514,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("branches.mergeIntoCurrentBranch"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMerge,
|
||||
Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"),
|
||||
},
|
||||
@@ -563,7 +521,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("branches.viewGitFlowOptions"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateGitFlowMenu,
|
||||
Description: gui.Tr.SLocalize("gitFlowOptions"),
|
||||
},
|
||||
@@ -571,7 +528,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("branches.FastForward"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleFastForward,
|
||||
Description: gui.Tr.SLocalize("FastForward"),
|
||||
},
|
||||
@@ -579,7 +535,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateResetToBranchMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
},
|
||||
@@ -587,15 +542,20 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("branches.renameBranch"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleRenameBranch,
|
||||
Description: gui.Tr.SLocalize("renameBranch"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"local-branches"},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.handleClipboardCopyBranch,
|
||||
Description: gui.Tr.SLocalize("copyBranchNameToClipboard"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCheckoutTag,
|
||||
Description: gui.Tr.SLocalize("checkout"),
|
||||
},
|
||||
@@ -603,7 +563,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleDeleteTag,
|
||||
Description: gui.Tr.SLocalize("deleteTag"),
|
||||
},
|
||||
@@ -611,7 +570,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Key: gui.getKey("branches.pushTag"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handlePushTag,
|
||||
Description: gui.Tr.SLocalize("pushTag"),
|
||||
},
|
||||
@@ -619,7 +577,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Key: gui.getKey("universal.new"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateTag,
|
||||
Description: gui.Tr.SLocalize("createTag"),
|
||||
},
|
||||
@@ -627,21 +584,18 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"tags"},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateResetToTagMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Key: gui.getKey("universal.nextTab"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleNextBranchesTab,
|
||||
Description: gui.Tr.SLocalize("nextTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Key: gui.getKey("universal.prevTab"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handlePrevBranchesTab,
|
||||
Description: gui.Tr.SLocalize("prevTab"),
|
||||
},
|
||||
@@ -649,7 +603,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remote-branches"},
|
||||
Key: gui.getKey("universal.return"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleRemoteBranchesEscape,
|
||||
Description: gui.Tr.SLocalize("ReturnToRemotesList"),
|
||||
},
|
||||
@@ -657,7 +610,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remote-branches"},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateResetToRemoteBranchMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
},
|
||||
@@ -665,21 +617,18 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remotes"},
|
||||
Key: gui.getKey("branches.fetchRemote"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleFetchRemote,
|
||||
Description: gui.Tr.SLocalize("fetchRemote"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Key: gui.getKey("universal.nextTab"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleNextCommitsTab,
|
||||
Description: gui.Tr.SLocalize("nextTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Key: gui.getKey("universal.prevTab"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handlePrevCommitsTab,
|
||||
Description: gui.Tr.SLocalize("prevTab"),
|
||||
},
|
||||
@@ -687,7 +636,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.squashDown"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitSquashDown,
|
||||
Description: gui.Tr.SLocalize("squashDown"),
|
||||
},
|
||||
@@ -695,7 +643,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.renameCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleRenameCommit,
|
||||
Description: gui.Tr.SLocalize("renameCommit"),
|
||||
},
|
||||
@@ -703,7 +650,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.renameCommitWithEditor"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleRenameCommitEditor,
|
||||
Description: gui.Tr.SLocalize("renameCommitEditor"),
|
||||
},
|
||||
@@ -711,7 +657,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateCommitResetMenu,
|
||||
Description: gui.Tr.SLocalize("resetToThisCommit"),
|
||||
},
|
||||
@@ -719,7 +664,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.markCommitAsFixup"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitFixup,
|
||||
Description: gui.Tr.SLocalize("fixupCommit"),
|
||||
},
|
||||
@@ -727,7 +671,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.createFixupCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateFixupCommit,
|
||||
Description: gui.Tr.SLocalize("createFixupCommit"),
|
||||
},
|
||||
@@ -735,7 +678,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.squashAboveCommits"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSquashAllAboveFixupCommits,
|
||||
Description: gui.Tr.SLocalize("squashAboveCommits"),
|
||||
},
|
||||
@@ -743,7 +685,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitDelete,
|
||||
Description: gui.Tr.SLocalize("deleteCommit"),
|
||||
},
|
||||
@@ -751,7 +692,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.moveDownCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitMoveDown,
|
||||
Description: gui.Tr.SLocalize("moveDownCommit"),
|
||||
},
|
||||
@@ -759,7 +699,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.moveUpCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitMoveUp,
|
||||
Description: gui.Tr.SLocalize("moveUpCommit"),
|
||||
},
|
||||
@@ -767,7 +706,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("universal.edit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitEdit,
|
||||
Description: gui.Tr.SLocalize("editCommit"),
|
||||
},
|
||||
@@ -775,7 +713,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.amendToCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitAmendTo,
|
||||
Description: gui.Tr.SLocalize("amendToCommit"),
|
||||
},
|
||||
@@ -783,7 +720,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.pickCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitPick,
|
||||
Description: gui.Tr.SLocalize("pickCommit"),
|
||||
},
|
||||
@@ -791,7 +727,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.revertCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitRevert,
|
||||
Description: gui.Tr.SLocalize("revertCommit"),
|
||||
},
|
||||
@@ -799,15 +734,20 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.cherryPickCopy"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCopyCommit,
|
||||
Description: gui.Tr.SLocalize("cherryPickCopy"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("universal.copyToClipboard"),
|
||||
Handler: gui.handleClipboardCopyCommit,
|
||||
Description: gui.Tr.SLocalize("copyCommitShaToClipboard"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.cherryPickCopyRange"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCopyCommitRange,
|
||||
Description: gui.Tr.SLocalize("cherryPickCopyRange"),
|
||||
},
|
||||
@@ -815,7 +755,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.pasteCommits"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.HandlePasteCommits,
|
||||
Description: gui.Tr.SLocalize("pasteCommits"),
|
||||
},
|
||||
@@ -823,7 +762,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("universal.goInto"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSwitchToCommitFilesPanel,
|
||||
Description: gui.Tr.SLocalize("viewCommitFiles"),
|
||||
},
|
||||
@@ -831,7 +769,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.checkoutCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCheckoutCommit,
|
||||
Description: gui.Tr.SLocalize("checkoutCommit"),
|
||||
},
|
||||
@@ -839,7 +776,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.tagCommit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleTagCommit,
|
||||
Description: gui.Tr.SLocalize("tagCommit"),
|
||||
},
|
||||
@@ -847,7 +783,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"branch-commits"},
|
||||
Key: gui.getKey("commits.resetCherryPick"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleResetCherryPick,
|
||||
Description: gui.Tr.SLocalize("resetCherryPick"),
|
||||
},
|
||||
@@ -855,7 +790,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"reflog-commits"},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCheckoutReflogCommit,
|
||||
Description: gui.Tr.SLocalize("checkoutCommit"),
|
||||
},
|
||||
@@ -863,28 +797,24 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "commits",
|
||||
Contexts: []string{"reflog-commits"},
|
||||
Key: gui.getKey("commits.viewResetOptions"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateReflogResetMenu,
|
||||
Description: gui.Tr.SLocalize("viewResetOptions"),
|
||||
},
|
||||
{
|
||||
ViewName: "stash",
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleStashApply,
|
||||
Description: gui.Tr.SLocalize("apply"),
|
||||
},
|
||||
{
|
||||
ViewName: "stash",
|
||||
Key: gui.getKey("stash.popStash"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleStashPop,
|
||||
Description: gui.Tr.SLocalize("pop"),
|
||||
},
|
||||
{
|
||||
ViewName: "stash",
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleStashDrop,
|
||||
Description: gui.Tr.SLocalize("drop"),
|
||||
},
|
||||
@@ -915,14 +845,12 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
{
|
||||
ViewName: "menu",
|
||||
Key: gui.getKey("universal.return"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMenuClose,
|
||||
Description: gui.Tr.SLocalize("closeMenu"),
|
||||
},
|
||||
{
|
||||
ViewName: "menu",
|
||||
Key: gui.getKey("universal.quit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMenuClose,
|
||||
Description: gui.Tr.SLocalize("closeMenu"),
|
||||
},
|
||||
@@ -935,56 +863,48 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
{
|
||||
ViewName: "commitFiles",
|
||||
Key: gui.getKey("universal.return"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSwitchToCommitsPanel,
|
||||
Description: gui.Tr.SLocalize("goBack"),
|
||||
},
|
||||
{
|
||||
ViewName: "commitFiles",
|
||||
Key: gui.getKey("commitFiles.checkoutCommitFile"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCheckoutCommitFile,
|
||||
Description: gui.Tr.SLocalize("checkoutCommitFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "commitFiles",
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleDiscardOldFileChange,
|
||||
Description: gui.Tr.SLocalize("discardOldFileChange"),
|
||||
},
|
||||
{
|
||||
ViewName: "commitFiles",
|
||||
Key: gui.getKey("universal.openFile"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleOpenOldCommitFile,
|
||||
Description: gui.Tr.SLocalize("openFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "commitFiles",
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleToggleFileForPatch,
|
||||
Description: gui.Tr.SLocalize("toggleAddToPatch"),
|
||||
},
|
||||
{
|
||||
ViewName: "commitFiles",
|
||||
Key: gui.getKey("universal.goInto"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleEnterCommitFile,
|
||||
Description: gui.Tr.SLocalize("enterFile"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.filteringMenu"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateFilteringMenuPanel,
|
||||
Description: gui.Tr.SLocalize("openScopingMenu"),
|
||||
},
|
||||
{
|
||||
ViewName: "",
|
||||
Key: gui.getKey("universal.diffingMenu"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCreateDiffingMenuPanel,
|
||||
Description: gui.Tr.SLocalize("openDiffingMenu"),
|
||||
},
|
||||
@@ -1011,7 +931,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"normal"},
|
||||
Key: gocui.MouseWheelDown,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollDownMain,
|
||||
Description: gui.Tr.SLocalize("ScrollDown"),
|
||||
Alternative: "fn+up",
|
||||
@@ -1020,7 +939,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"normal"},
|
||||
Key: gocui.MouseWheelUp,
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.scrollUpMain,
|
||||
Description: gui.Tr.SLocalize("ScrollUp"),
|
||||
Alternative: "fn+down",
|
||||
@@ -1043,7 +961,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Key: gui.getKey("universal.return"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleStagingEscape,
|
||||
Description: gui.Tr.SLocalize("ReturnToFilesPanel"),
|
||||
},
|
||||
@@ -1051,7 +968,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleToggleStagedSelection,
|
||||
Description: gui.Tr.SLocalize("StageSelection"),
|
||||
},
|
||||
@@ -1059,7 +975,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleResetSelection,
|
||||
Description: gui.Tr.SLocalize("ResetSelection"),
|
||||
},
|
||||
@@ -1067,7 +982,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Key: gui.getKey("universal.togglePanel"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleTogglePanel,
|
||||
Description: gui.Tr.SLocalize("TogglePanel"),
|
||||
},
|
||||
@@ -1075,7 +989,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patch-building"},
|
||||
Key: gui.getKey("universal.return"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleEscapePatchBuildingPanel,
|
||||
Description: gui.Tr.SLocalize("ExitLineByLineMode"),
|
||||
},
|
||||
@@ -1083,7 +996,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patch-building", "staging"},
|
||||
Key: gui.getKey("universal.prevItem"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevLine,
|
||||
Description: gui.Tr.SLocalize("PrevLine"),
|
||||
},
|
||||
@@ -1091,7 +1003,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patch-building", "staging"},
|
||||
Key: gui.getKey("universal.nextItem"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextLine,
|
||||
Description: gui.Tr.SLocalize("NextLine"),
|
||||
},
|
||||
@@ -1127,7 +1038,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patch-building", "staging"},
|
||||
Key: gui.getKey("universal.prevBlock"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevHunk,
|
||||
Description: gui.Tr.SLocalize("PrevHunk"),
|
||||
},
|
||||
@@ -1135,7 +1045,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patch-building", "staging"},
|
||||
Key: gui.getKey("universal.nextBlock"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextHunk,
|
||||
Description: gui.Tr.SLocalize("NextHunk"),
|
||||
},
|
||||
@@ -1157,7 +1066,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Key: gui.getKey("universal.edit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleFileEdit,
|
||||
Description: gui.Tr.SLocalize("editFile"),
|
||||
},
|
||||
@@ -1165,7 +1073,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Key: gui.getKey("universal.openFile"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleFileOpen,
|
||||
Description: gui.Tr.SLocalize("openFile"),
|
||||
},
|
||||
@@ -1173,7 +1080,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patch-building"},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleToggleSelectionForPatch,
|
||||
Description: gui.Tr.SLocalize("ToggleSelectionForPatch"),
|
||||
},
|
||||
@@ -1181,7 +1087,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patch-building", "staging"},
|
||||
Key: gui.getKey("main.toggleDragSelect"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleToggleSelectRange,
|
||||
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
||||
},
|
||||
@@ -1190,7 +1095,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patch-building", "staging"},
|
||||
Key: gui.getKey("main.toggleDragSelect-alt"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleToggleSelectRange,
|
||||
Description: gui.Tr.SLocalize("ToggleDragSelect"),
|
||||
},
|
||||
@@ -1198,7 +1102,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"patch-building", "staging"},
|
||||
Key: gui.getKey("main.toggleSelectHunk"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleToggleSelectHunk,
|
||||
Description: gui.Tr.SLocalize("ToggleSelectHunk"),
|
||||
},
|
||||
@@ -1234,7 +1137,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Key: gui.getKey("files.commitChanges"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitPress,
|
||||
Description: gui.Tr.SLocalize("CommitChanges"),
|
||||
},
|
||||
@@ -1242,7 +1144,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Key: gui.getKey("files.commitChangesWithoutHook"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleWIPCommitPress,
|
||||
Description: gui.Tr.SLocalize("commitChangesWithoutHook"),
|
||||
},
|
||||
@@ -1250,7 +1151,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"staging"},
|
||||
Key: gui.getKey("files.commitChangesWithEditor"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCommitEditorPress,
|
||||
Description: gui.Tr.SLocalize("CommitChangesWithEditor"),
|
||||
},
|
||||
@@ -1258,7 +1158,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Key: gui.getKey("universal.return"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleEscapeMerge,
|
||||
Description: gui.Tr.SLocalize("ReturnToFilesPanel"),
|
||||
},
|
||||
@@ -1266,7 +1165,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handlePickHunk,
|
||||
Description: gui.Tr.SLocalize("PickHunk"),
|
||||
},
|
||||
@@ -1274,7 +1172,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Key: gui.getKey("main.pickBothHunks"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handlePickBothHunks,
|
||||
Description: gui.Tr.SLocalize("PickBothHunks"),
|
||||
},
|
||||
@@ -1282,7 +1179,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Key: gui.getKey("universal.prevBlock"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectPrevConflict,
|
||||
Description: gui.Tr.SLocalize("PrevConflict"),
|
||||
},
|
||||
@@ -1290,7 +1186,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Key: gui.getKey("universal.nextBlock"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectNextConflict,
|
||||
Description: gui.Tr.SLocalize("NextConflict"),
|
||||
},
|
||||
@@ -1298,7 +1193,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Key: gui.getKey("universal.prevItem"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectTop,
|
||||
Description: gui.Tr.SLocalize("SelectTop"),
|
||||
},
|
||||
@@ -1306,7 +1200,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Key: gui.getKey("universal.nextItem"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSelectBottom,
|
||||
Description: gui.Tr.SLocalize("SelectBottom"),
|
||||
},
|
||||
@@ -1356,7 +1249,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "main",
|
||||
Contexts: []string{"merging"},
|
||||
Key: gui.getKey("universal.undo"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handlePopFileSnapshot,
|
||||
Description: gui.Tr.SLocalize("undo"),
|
||||
},
|
||||
@@ -1371,7 +1263,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remotes"},
|
||||
Key: gui.getKey("universal.new"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleAddRemote,
|
||||
Description: gui.Tr.SLocalize("addNewRemote"),
|
||||
},
|
||||
@@ -1379,7 +1270,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remotes"},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleRemoveRemote,
|
||||
Description: gui.Tr.SLocalize("removeRemote"),
|
||||
},
|
||||
@@ -1387,7 +1277,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remotes"},
|
||||
Key: gui.getKey("universal.edit"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleEditRemote,
|
||||
Description: gui.Tr.SLocalize("editRemote"),
|
||||
},
|
||||
@@ -1395,7 +1284,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remote-branches"},
|
||||
Key: gui.getKey("universal.select"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleCheckoutRemoteBranch,
|
||||
Description: gui.Tr.SLocalize("checkout"),
|
||||
},
|
||||
@@ -1403,7 +1291,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remote-branches"},
|
||||
Key: gui.getKey("branches.mergeIntoCurrentBranch"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleMergeRemoteBranch,
|
||||
Description: gui.Tr.SLocalize("mergeIntoCurrentBranch"),
|
||||
},
|
||||
@@ -1411,7 +1298,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remote-branches"},
|
||||
Key: gui.getKey("universal.remove"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleDeleteRemoteBranch,
|
||||
Description: gui.Tr.SLocalize("deleteBranch"),
|
||||
},
|
||||
@@ -1419,7 +1305,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remote-branches"},
|
||||
Key: gui.getKey("branches.rebaseBranch"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleRebaseOntoRemoteBranch,
|
||||
Description: gui.Tr.SLocalize("rebaseBranch"),
|
||||
},
|
||||
@@ -1427,7 +1312,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: "branches",
|
||||
Contexts: []string{"remote-branches"},
|
||||
Key: gui.getKey("branches.setUpstream"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleSetBranchUpstream,
|
||||
Description: gui.Tr.SLocalize("setUpstream"),
|
||||
},
|
||||
@@ -1529,7 +1413,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: listView.viewName,
|
||||
Contexts: []string{listView.context},
|
||||
Key: gui.getKey("universal.startSearch"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: openSearchHandler,
|
||||
Description: gui.Tr.SLocalize("startSearch"),
|
||||
},
|
||||
@@ -1537,7 +1420,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
ViewName: listView.viewName,
|
||||
Contexts: []string{listView.context},
|
||||
Key: gui.getKey("universal.gotoBottom"),
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gotoBottomHandler,
|
||||
Description: gui.Tr.SLocalize("gotoBottom"),
|
||||
},
|
||||
|
||||
@@ -113,7 +113,7 @@ func (gui *Gui) handleResetSelection(g *gocui.Gui, v *gocui.View) error {
|
||||
return gui.applySelection(true)
|
||||
}
|
||||
|
||||
if gui.Config.GetUserConfig().GetBool("gui.skipUnstageLineWarning") {
|
||||
if !gui.Config.GetUserConfig().GetBool("gui.skipUnstageLineWarning") {
|
||||
return gui.createConfirmationPanel(gui.g, gui.getMainView(), false, "unstage lines", "Are you sure you want to delete the selected lines (git reset)? It is irreversible.\nTo disable this dialogue set the config key of 'gui.skipUnstageLineWarning' to true", func(*gocui.Gui, *gocui.View) error {
|
||||
return gui.applySelection(true)
|
||||
}, nil)
|
||||
|
||||
@@ -66,11 +66,39 @@ func (gui *Gui) refreshStashEntries(g *gocui.Gui) error {
|
||||
// specific functions
|
||||
|
||||
func (gui *Gui) handleStashApply(g *gocui.Gui, v *gocui.View) error {
|
||||
return gui.stashDo(g, v, "apply")
|
||||
skipStashWarning := gui.Config.GetUserConfig().GetBool("gui.skipStashWarning")
|
||||
|
||||
apply := func() error {
|
||||
return gui.stashDo(g, v, "apply")
|
||||
}
|
||||
|
||||
if skipStashWarning {
|
||||
return apply()
|
||||
}
|
||||
|
||||
title := gui.Tr.SLocalize("StashApply")
|
||||
message := gui.Tr.SLocalize("SureApplyStashEntry")
|
||||
return gui.createConfirmationPanel(g, v, true, title, message, func(g *gocui.Gui, v *gocui.View) error {
|
||||
return apply()
|
||||
}, nil)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleStashPop(g *gocui.Gui, v *gocui.View) error {
|
||||
return gui.stashDo(g, v, "pop")
|
||||
skipStashWarning := gui.Config.GetUserConfig().GetBool("gui.skipStashWarning")
|
||||
|
||||
pop := func() error {
|
||||
return gui.stashDo(g, v, "pop")
|
||||
}
|
||||
|
||||
if skipStashWarning {
|
||||
return pop()
|
||||
}
|
||||
|
||||
title := gui.Tr.SLocalize("StashPop")
|
||||
message := gui.Tr.SLocalize("SurePopStashEntry")
|
||||
return gui.createConfirmationPanel(g, v, true, title, message, func(g *gocui.Gui, v *gocui.View) error {
|
||||
return pop()
|
||||
}, nil)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleStashDrop(g *gocui.Gui, v *gocui.View) error {
|
||||
|
||||
@@ -763,6 +763,9 @@ func addDutch(i18nObject *i18n.Bundle) error {
|
||||
}, &i18n.Message{
|
||||
ID: "IgnoreTrackedPrompt",
|
||||
Other: "Are you sure you want to ignore a tracked file?",
|
||||
}, &i18n.Message{
|
||||
ID: "commitPrefixPatternError",
|
||||
Other: "Error in commitPrefix pattern",
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -378,6 +378,18 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
||||
}, &i18n.Message{
|
||||
ID: "SureDropStashEntry",
|
||||
Other: "Are you sure you want to drop this stash entry?",
|
||||
}, &i18n.Message{
|
||||
ID: "StashPop",
|
||||
Other: "Stash pop",
|
||||
}, &i18n.Message{
|
||||
ID: "SurePopStashEntry",
|
||||
Other: "Are you sure you want to pop this stash entry?",
|
||||
}, &i18n.Message{
|
||||
ID: "StashApply",
|
||||
Other: "Stash apply",
|
||||
}, &i18n.Message{
|
||||
ID: "SureApplyStashEntry",
|
||||
Other: "Are you sure you want to apply this stash entry?",
|
||||
}, &i18n.Message{
|
||||
ID: "NoStashTo",
|
||||
Other: "No stash to {{.method}}",
|
||||
@@ -1131,6 +1143,15 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
||||
}, &i18n.Message{
|
||||
ID: "showingGitDiff",
|
||||
Other: "showing output for:",
|
||||
}, &i18n.Message{
|
||||
ID: "copyCommitShaToClipboard",
|
||||
Other: "copy commit SHA to clipboard",
|
||||
}, &i18n.Message{
|
||||
ID: "copyBranchNameToClipboard",
|
||||
Other: "copy branch name to clipboard",
|
||||
}, &i18n.Message{
|
||||
ID: "commitPrefixPatternError",
|
||||
Other: "Error in commitPrefix pattern",
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -746,6 +746,9 @@ func addPolish(i18nObject *i18n.Bundle) error {
|
||||
}, &i18n.Message{
|
||||
ID: "IgnoreTrackedPrompt",
|
||||
Other: "Are you sure you want to ignore a tracked file?",
|
||||
}, &i18n.Message{
|
||||
ID: "commitPrefixPatternError",
|
||||
Other: "Error in commitPrefix pattern",
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user