mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
Add config for soft-wrapping the commit message body
This commit is contained in:
parent
99ad6005e8
commit
cede021400
4 changed files with 21 additions and 1 deletions
|
@ -92,6 +92,8 @@ git:
|
||||||
useConfig: false
|
useConfig: false
|
||||||
commit:
|
commit:
|
||||||
signOff: false
|
signOff: false
|
||||||
|
autoWrapCommitMessage: true # automatic WYSIWYG wrapping of the commit message as you type
|
||||||
|
autoWrapWidth: 72 # if autoWrapCommitMessage is true, the width to wrap to
|
||||||
merging:
|
merging:
|
||||||
# only applicable to unix users
|
# only applicable to unix users
|
||||||
manualCommit: false
|
manualCommit: false
|
||||||
|
|
|
@ -236,6 +236,10 @@ type PagingConfig struct {
|
||||||
type CommitConfig struct {
|
type CommitConfig struct {
|
||||||
// If true, pass '--signoff' flag when committing
|
// If true, pass '--signoff' flag when committing
|
||||||
SignOff bool `yaml:"signOff"`
|
SignOff bool `yaml:"signOff"`
|
||||||
|
// Automatic WYSIWYG wrapping of the commit message as you type
|
||||||
|
AutoWrapCommitMessage bool `yaml:"autoWrapCommitMessage"`
|
||||||
|
// If autoWrapCommitMessage is true, the width to wrap to
|
||||||
|
AutoWrapWidth int `yaml:"autoWrapWidth"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MergingConfig struct {
|
type MergingConfig struct {
|
||||||
|
@ -658,7 +662,9 @@ func GetDefaultConfig() *UserConfig {
|
||||||
ExternalDiffCommand: "",
|
ExternalDiffCommand: "",
|
||||||
},
|
},
|
||||||
Commit: CommitConfig{
|
Commit: CommitConfig{
|
||||||
SignOff: false,
|
SignOff: false,
|
||||||
|
AutoWrapCommitMessage: true,
|
||||||
|
AutoWrapWidth: 72,
|
||||||
},
|
},
|
||||||
Merging: MergingConfig{
|
Merging: MergingConfig{
|
||||||
ManualCommit: false,
|
ManualCommit: false,
|
||||||
|
|
|
@ -168,6 +168,8 @@ func (gui *Gui) createAllViews() error {
|
||||||
gui.Views.CommitDescription.FgColor = theme.GocuiDefaultTextColor
|
gui.Views.CommitDescription.FgColor = theme.GocuiDefaultTextColor
|
||||||
gui.Views.CommitDescription.Editable = true
|
gui.Views.CommitDescription.Editable = true
|
||||||
gui.Views.CommitDescription.Editor = gocui.EditorFunc(gui.commitDescriptionEditor)
|
gui.Views.CommitDescription.Editor = gocui.EditorFunc(gui.commitDescriptionEditor)
|
||||||
|
gui.Views.CommitDescription.TextArea.AutoWrap = gui.c.UserConfig.Git.Commit.AutoWrapCommitMessage
|
||||||
|
gui.Views.CommitDescription.TextArea.AutoWrapWidth = gui.c.UserConfig.Git.Commit.AutoWrapWidth
|
||||||
|
|
||||||
gui.Views.Confirmation.Visible = false
|
gui.Views.Confirmation.Visible = false
|
||||||
gui.Views.Confirmation.Editor = gocui.EditorFunc(gui.promptEditor)
|
gui.Views.Confirmation.Editor = gocui.EditorFunc(gui.promptEditor)
|
||||||
|
|
|
@ -405,6 +405,16 @@
|
||||||
"signOff": {
|
"signOff": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "If true, pass '--signoff' flag when committing"
|
"description": "If true, pass '--signoff' flag when committing"
|
||||||
|
},
|
||||||
|
"autoWrapCommitMessage": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Automatic WYSIWYG wrapping of the commit message as you type",
|
||||||
|
"default": true
|
||||||
|
},
|
||||||
|
"autoWrapWidth": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "If autoWrapCommitMessage is true, the width to wrap to",
|
||||||
|
"default": 72
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue