From ad52544df868c585cd00c4b17a8c83b75e2a20a6 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 12 Nov 2026 08:55:14 +0100 Subject: [PATCH] Add a test for pasting text into the commit description It checks that the text goes in at the cursor, and that a tab turns into spaces instead of switching to the summary. Co-Authored-By: Claude Opus 5.5 --- .../commit/paste_into_commit_description.go | 31 +++++++++++++++++++ pkg/integration/tests/test_list.go | 1 + 2 files changed, 32 insertions(+) create mode 100644 pkg/integration/tests/commit/paste_into_commit_description.go diff --git a/pkg/integration/tests/commit/paste_into_commit_description.go b/pkg/integration/tests/commit/paste_into_commit_description.go new file mode 100644 index 000000000..353ca7f2d --- /dev/null +++ b/pkg/integration/tests/commit/paste_into_commit_description.go @@ -0,0 +1,31 @@ +package commit + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var PasteIntoCommitDescription = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Paste text into the commit description 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(). + Type("subject"). + SwitchToDescription(). + Type("last line"). + GoToBeginning(). + Paste("first line\n\tindented line\n"). + Content(Equals("first line\n indented line\nlast line")) + + t.ExpectPopup().CommitDescriptionPanel() + }, +}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 26edb3c13..4acb7f181 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -186,6 +186,7 @@ var tests = []*components.IntegrationTest{ commit.PasteCommitMessage, commit.PasteCommitMessageOverExisting, commit.PasteCommitMessageWithHardLineBreaks, + commit.PasteIntoCommitDescription, commit.PreserveCommitMessage, commit.PreserveCommitMessageWhitespace, commit.ResetAuthor,