mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-18 03:49:50 -06:00
If you paste text into an empty description, drop the newlines at its start. This happens when you paste a whole commit message into the summary with the terminal's paste command. The part after the first line goes into the description, and it starts with the blank line between subject and body. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
31 lines
860 B
Go
31 lines
860 B
Go
package commit
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var PasteMultiLineCommitMessage = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Paste a multi-line commit message into the summary with the terminal's paste command",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupConfig: func(config *config.AppConfig) {},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.CreateFileAndAdd("file", "file content")
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Files().
|
|
Focus().
|
|
Press(keys.Files.CommitChanges)
|
|
|
|
t.ExpectPopup().CommitMessagePanel().
|
|
Paste("subject\n\nbody line 1\nbody line 2").
|
|
Content(Equals("subject"))
|
|
|
|
t.Views().CommitDescription().
|
|
IsFocused().
|
|
Content(Equals(
|
|
"body line 1\nbody line 2"))
|
|
},
|
|
})
|