1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-13 22:17:05 +02:00

Add user config gui.skipRewordInEditorWarning

This commit is contained in:
stk 2023-01-22 15:09:13 +01:00
parent b8d33b8f7b
commit 67fb28e2b8
3 changed files with 45 additions and 38 deletions

View File

@ -61,6 +61,7 @@ gui:
showIcons: false
commandLogSize: 8
splitDiff: 'auto' # one of 'auto' | 'always'
skipRewordInEditorWarning: false # for skipping the confirmation before launching the reword editor
git:
paging:
colorArg: always

View File

@ -50,6 +50,7 @@ type GuiConfig struct {
ShowIcons bool `yaml:"showIcons"`
CommandLogSize int `yaml:"commandLogSize"`
SplitDiff string `yaml:"splitDiff"`
SkipRewordInEditorWarning bool `yaml:"skipRewordInEditorWarning"`
}
type ThemeConfig struct {
@ -378,6 +379,7 @@ func GetDefaultConfig() *UserConfig {
ShowIcons: false,
CommandLogSize: 8,
SplitDiff: "auto",
SkipRewordInEditorWarning: false,
},
Git: GitConfig{
Paging: PagingConfig{

View File

@ -255,11 +255,15 @@ func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
return nil
}
if self.c.UserConfig.Gui.SkipRewordInEditorWarning {
return self.doRewordEditor()
} else {
return self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.RewordInEditorTitle,
Prompt: self.c.Tr.RewordInEditorPrompt,
HandleConfirm: self.doRewordEditor,
})
}
}
func (self *LocalCommitsController) drop(commit *models.Commit) error {