Repository: jesseduffield/lazygit (language: go)

Issue:
Branch name cut off when pushing upstream
**Describe the bug**
When pushing a branch upstream, an input field + suggestions box show up. However, the input field, already containing the current branch name, is 'scrolled' all the way to the end. This can be annoying if the input field has enough room to display the complete branch name.

**To Reproduce**
Steps to reproduce the behavior:

1. Push branch upstream

<img width="913" alt="image" src="https://user-images.githubusercontent.com/6158959/185143102-e2c07fd2-14ac-4de2-a008-c7f5b03ce94c.png">


**Expected behavior**
This is how I'd expect it to look. (after scrolling all the way to the left)
<img width="908" alt="image" src="https://user-images.githubusercontent.com/6158959/185143694-8bc393b2-c933-4c01-bfaa-5844e4635a99.png">


**Version info:**
_Run `lazygit --version` and paste the result here_
```
commit=367b0d331836c90c015bf0c45f88612f3d94d08a, build date=2022-07-20T09:27:56Z, build source=binaryRelease, version=0.35, os=darwin, arch=arm64
```

_Run `git --version` and paste the result here_
```
git version 2.37.2
```



Discussion / hints:
I saw this in an integration test the other day. Very annoying. But a git bisect should get us to the cause pretty quick. I'll chuck a good-first-issue label on this and anybody who wants to pick it up and doesn't know what git bisect is, reach out!

Fix patch:
diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go
index 1ad724ad546..16bc551be56 100644
--- a/pkg/gui/confirmation_panel.go
+++ b/pkg/gui/confirmation_panel.go
@@ -122,6 +122,7 @@ func (gui *Gui) prepareConfirmationPanel(
 	gui.Views.Confirmation.Wrap = !opts.Editable
 	gui.Views.Confirmation.FgColor = theme.GocuiDefaultTextColor
 	gui.Views.Confirmation.Mask = runeForMask(opts.Mask)
+	_ = gui.Views.Confirmation.SetOrigin(0, 0)
 
 	gui.findSuggestions = opts.FindSuggestionsFunc
 	if opts.FindSuggestionsFunc != nil {
@@ -133,6 +134,7 @@ func (gui *Gui) prepareConfirmationPanel(
 		suggestionsView.Title = fmt.Sprintf(gui.c.Tr.SuggestionsTitle, gui.c.UserConfig.Keybinding.Universal.TogglePanel)
 	}
 
+	gui.resizeConfirmationPanel()
 	return nil
 }
 
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go
index 40bc2fa029a..713639251e0 100644
--- a/pkg/gui/view_helpers.go
+++ b/pkg/gui/view_helpers.go
@@ -87,7 +87,8 @@ func (gui *Gui) resizeConfirmationPanel() {
 	}
 	panelWidth := gui.getConfirmationPanelWidth()
 	prompt := gui.Views.Confirmation.Buffer()
-	panelHeight := gui.getMessageHeight(true, prompt, panelWidth) + suggestionsViewHeight
+	wrap := !gui.Views.Confirmation.Editable
+	panelHeight := gui.getMessageHeight(wrap, prompt, panelWidth) + suggestionsViewHeight
 	x0, y0, x1, y1 := gui.getConfirmationPanelDimensionsAux(panelWidth, panelHeight)
 	confirmationViewBottom := y1 - suggestionsViewHeight
 	_, _ = gui.g.SetView(gui.Views.Confirmation.Name(), x0, y0, x1, confirmationViewBottom, 0)


Test patch: