mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-23 12:18:51 +02:00
Merge pull request #2384 from stefanhaller/disable-reword-in-editor-prompt
This commit is contained in:
commit
18db5eafd4
@ -61,6 +61,7 @@ gui:
|
|||||||
showIcons: false
|
showIcons: false
|
||||||
commandLogSize: 8
|
commandLogSize: 8
|
||||||
splitDiff: 'auto' # one of 'auto' | 'always'
|
splitDiff: 'auto' # one of 'auto' | 'always'
|
||||||
|
skipRewordInEditorWarning: false # for skipping the confirmation before launching the reword editor
|
||||||
git:
|
git:
|
||||||
paging:
|
paging:
|
||||||
colorArg: always
|
colorArg: always
|
||||||
|
@ -50,6 +50,7 @@ type GuiConfig struct {
|
|||||||
ShowIcons bool `yaml:"showIcons"`
|
ShowIcons bool `yaml:"showIcons"`
|
||||||
CommandLogSize int `yaml:"commandLogSize"`
|
CommandLogSize int `yaml:"commandLogSize"`
|
||||||
SplitDiff string `yaml:"splitDiff"`
|
SplitDiff string `yaml:"splitDiff"`
|
||||||
|
SkipRewordInEditorWarning bool `yaml:"skipRewordInEditorWarning"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ThemeConfig struct {
|
type ThemeConfig struct {
|
||||||
@ -378,6 +379,7 @@ func GetDefaultConfig() *UserConfig {
|
|||||||
ShowIcons: false,
|
ShowIcons: false,
|
||||||
CommandLogSize: 8,
|
CommandLogSize: 8,
|
||||||
SplitDiff: "auto",
|
SplitDiff: "auto",
|
||||||
|
SkipRewordInEditorWarning: false,
|
||||||
},
|
},
|
||||||
Git: GitConfig{
|
Git: GitConfig{
|
||||||
Paging: PagingConfig{
|
Paging: PagingConfig{
|
||||||
|
@ -226,19 +226,7 @@ func (self *LocalCommitsController) reword(commit *models.Commit) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
|
func (self *LocalCommitsController) doRewordEditor() error {
|
||||||
midRebase, err := self.handleMidRebaseCommand("reword", commit)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if midRebase {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return self.c.Confirm(types.ConfirmOpts{
|
|
||||||
Title: self.c.Tr.RewordInEditorTitle,
|
|
||||||
Prompt: self.c.Tr.RewordInEditorPrompt,
|
|
||||||
HandleConfirm: func() error {
|
|
||||||
self.c.LogAction(self.c.Tr.Actions.RewordCommit)
|
self.c.LogAction(self.c.Tr.Actions.RewordCommit)
|
||||||
|
|
||||||
if self.context().GetSelectedLineIdx() == 0 {
|
if self.context().GetSelectedLineIdx() == 0 {
|
||||||
@ -256,8 +244,26 @@ func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
},
|
}
|
||||||
|
|
||||||
|
func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
|
||||||
|
midRebase, err := self.handleMidRebaseCommand("reword", commit)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if midRebase {
|
||||||
|
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 {
|
func (self *LocalCommitsController) drop(commit *models.Commit) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user