diff --git a/pkg/gui/controllers/helpers/confirmation_helper.go b/pkg/gui/controllers/helpers/confirmation_helper.go index 20b224f4d..df059bef4 100644 --- a/pkg/gui/controllers/helpers/confirmation_helper.go +++ b/pkg/gui/controllers/helpers/confirmation_helper.go @@ -3,6 +3,7 @@ package helpers import ( goContext "context" "fmt" + "strings" "github.com/jesseduffield/lazygit/pkg/gui/style" "github.com/jesseduffield/lazygit/pkg/gui/types" @@ -168,7 +169,7 @@ func (self *ConfirmationHelper) CreatePopupPanel(ctx goContext.Context, opts typ confirmationView.RenderTextArea() } else { self.c.ResetViewOrigin(confirmationView) - self.c.SetViewContent(confirmationView, style.AttrBold.Sprint(opts.Prompt)) + self.c.SetViewContent(confirmationView, style.AttrBold.Sprint(strings.TrimSpace(opts.Prompt))) } self.setKeyBindings(cancel, opts) diff --git a/pkg/utils/lines_test.go b/pkg/utils/lines_test.go index a67d59237..973310a33 100644 --- a/pkg/utils/lines_test.go +++ b/pkg/utils/lines_test.go @@ -405,20 +405,6 @@ func TestWrapViewLinesToWidth(t *testing.T) { expectedWrappedLinesIndices: []int{0, 1, 2}, expectedOriginalLinesIndices: []int{0, 1, 2}, }, - { - name: "Avoid blank line at end if not editable", - wrap: true, - editable: false, - text: "First\nSecond\nThird\n", - width: 10, - expectedWrappedLines: []string{ - "First", - "Second", - "Third", - }, - expectedWrappedLinesIndices: []int{0, 1, 2}, - expectedOriginalLinesIndices: []int{0, 1, 2}, - }, { name: "Keep blank line at end if editable", wrap: true,