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 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

View File

@ -27,29 +27,30 @@ type RefresherConfig struct {
} }
type GuiConfig struct { type GuiConfig struct {
AuthorColors map[string]string `yaml:"authorColors"` AuthorColors map[string]string `yaml:"authorColors"`
BranchColors map[string]string `yaml:"branchColors"` BranchColors map[string]string `yaml:"branchColors"`
ScrollHeight int `yaml:"scrollHeight"` ScrollHeight int `yaml:"scrollHeight"`
ScrollPastBottom bool `yaml:"scrollPastBottom"` ScrollPastBottom bool `yaml:"scrollPastBottom"`
MouseEvents bool `yaml:"mouseEvents"` MouseEvents bool `yaml:"mouseEvents"`
SkipUnstageLineWarning bool `yaml:"skipUnstageLineWarning"` SkipUnstageLineWarning bool `yaml:"skipUnstageLineWarning"`
SkipStashWarning bool `yaml:"skipStashWarning"` SkipStashWarning bool `yaml:"skipStashWarning"`
SidePanelWidth float64 `yaml:"sidePanelWidth"` SidePanelWidth float64 `yaml:"sidePanelWidth"`
ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"` ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"`
MainPanelSplitMode string `yaml:"mainPanelSplitMode"` MainPanelSplitMode string `yaml:"mainPanelSplitMode"`
Language string `yaml:"language"` Language string `yaml:"language"`
TimeFormat string `yaml:"timeFormat"` TimeFormat string `yaml:"timeFormat"`
Theme ThemeConfig `yaml:"theme"` Theme ThemeConfig `yaml:"theme"`
CommitLength CommitLengthConfig `yaml:"commitLength"` CommitLength CommitLengthConfig `yaml:"commitLength"`
SkipNoStagedFilesWarning bool `yaml:"skipNoStagedFilesWarning"` SkipNoStagedFilesWarning bool `yaml:"skipNoStagedFilesWarning"`
ShowListFooter bool `yaml:"showListFooter"` ShowListFooter bool `yaml:"showListFooter"`
ShowFileTree bool `yaml:"showFileTree"` ShowFileTree bool `yaml:"showFileTree"`
ShowRandomTip bool `yaml:"showRandomTip"` ShowRandomTip bool `yaml:"showRandomTip"`
ShowCommandLog bool `yaml:"showCommandLog"` ShowCommandLog bool `yaml:"showCommandLog"`
ShowBottomLine bool `yaml:"showBottomLine"` ShowBottomLine bool `yaml:"showBottomLine"`
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 {
@ -368,16 +369,17 @@ func GetDefaultConfig() *UserConfig {
UnstagedChangesColor: []string{"red"}, UnstagedChangesColor: []string{"red"},
DefaultFgColor: []string{"default"}, DefaultFgColor: []string{"default"},
}, },
CommitLength: CommitLengthConfig{Show: true}, CommitLength: CommitLengthConfig{Show: true},
SkipNoStagedFilesWarning: false, SkipNoStagedFilesWarning: false,
ShowListFooter: true, ShowListFooter: true,
ShowCommandLog: true, ShowCommandLog: true,
ShowBottomLine: true, ShowBottomLine: true,
ShowFileTree: true, ShowFileTree: true,
ShowRandomTip: true, ShowRandomTip: true,
ShowIcons: false, ShowIcons: false,
CommandLogSize: 8, CommandLogSize: 8,
SplitDiff: "auto", SplitDiff: "auto",
SkipRewordInEditorWarning: false,
}, },
Git: GitConfig{ Git: GitConfig{
Paging: PagingConfig{ Paging: PagingConfig{

View File

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