mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-22 05:29:44 +02:00
Support custom keybindings for confirm discard (#2960)
This commit is contained in:
commit
efd49f07fd
@ -207,6 +207,7 @@ keybinding:
|
|||||||
commitChangesWithoutHook: 'w' # commit changes without pre-commit hook
|
commitChangesWithoutHook: 'w' # commit changes without pre-commit hook
|
||||||
amendLastCommit: 'A'
|
amendLastCommit: 'A'
|
||||||
commitChangesWithEditor: 'C'
|
commitChangesWithEditor: 'C'
|
||||||
|
confirmDiscard: 'x'
|
||||||
ignoreFile: 'i'
|
ignoreFile: 'i'
|
||||||
refreshFiles: 'r'
|
refreshFiles: 'r'
|
||||||
stashAllChanges: 's'
|
stashAllChanges: 's'
|
||||||
|
@ -223,6 +223,7 @@ type KeybindingFilesConfig struct {
|
|||||||
CommitChangesWithoutHook string `yaml:"commitChangesWithoutHook"`
|
CommitChangesWithoutHook string `yaml:"commitChangesWithoutHook"`
|
||||||
AmendLastCommit string `yaml:"amendLastCommit"`
|
AmendLastCommit string `yaml:"amendLastCommit"`
|
||||||
CommitChangesWithEditor string `yaml:"commitChangesWithEditor"`
|
CommitChangesWithEditor string `yaml:"commitChangesWithEditor"`
|
||||||
|
ConfirmDiscard string `yaml:"confirmDiscard"`
|
||||||
IgnoreFile string `yaml:"ignoreFile"`
|
IgnoreFile string `yaml:"ignoreFile"`
|
||||||
RefreshFiles string `yaml:"refreshFiles"`
|
RefreshFiles string `yaml:"refreshFiles"`
|
||||||
StashAllChanges string `yaml:"stashAllChanges"`
|
StashAllChanges string `yaml:"stashAllChanges"`
|
||||||
@ -592,6 +593,7 @@ func GetDefaultConfig() *UserConfig {
|
|||||||
ToggleTreeView: "`",
|
ToggleTreeView: "`",
|
||||||
OpenMergeTool: "M",
|
OpenMergeTool: "M",
|
||||||
OpenStatusFilter: "<c-b>",
|
OpenStatusFilter: "<c-b>",
|
||||||
|
ConfirmDiscard: "x",
|
||||||
},
|
},
|
||||||
Branches: KeybindingBranchesConfig{
|
Branches: KeybindingBranchesConfig{
|
||||||
CopyPullRequestURL: "<c-y>",
|
CopyPullRequestURL: "<c-y>",
|
||||||
|
@ -53,7 +53,7 @@ func (self *FilesRemoveController) remove(node *filetree.FileNode) error {
|
|||||||
}
|
}
|
||||||
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES, types.WORKTREES}})
|
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES, types.WORKTREES}})
|
||||||
},
|
},
|
||||||
Key: 'x',
|
Key: self.c.KeybindingsOpts().GetKey(self.c.UserConfig.Keybinding.Files.ConfirmDiscard),
|
||||||
Tooltip: utils.ResolvePlaceholderString(
|
Tooltip: utils.ResolvePlaceholderString(
|
||||||
self.c.Tr.DiscardAllTooltip,
|
self.c.Tr.DiscardAllTooltip,
|
||||||
map[string]string{
|
map[string]string{
|
||||||
@ -109,7 +109,7 @@ func (self *FilesRemoveController) remove(node *filetree.FileNode) error {
|
|||||||
}
|
}
|
||||||
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES, types.WORKTREES}})
|
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES, types.WORKTREES}})
|
||||||
},
|
},
|
||||||
Key: 'x',
|
Key: self.c.KeybindingsOpts().GetKey(self.c.UserConfig.Keybinding.Files.ConfirmDiscard),
|
||||||
Tooltip: utils.ResolvePlaceholderString(
|
Tooltip: utils.ResolvePlaceholderString(
|
||||||
self.c.Tr.DiscardAllTooltip,
|
self.c.Tr.DiscardAllTooltip,
|
||||||
map[string]string{
|
map[string]string{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user