Skip to content

Commit

Permalink
fix(confirmation_panel.go): fix initial origin of editor box
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryooooooga committed Sep 1, 2022
1 parent 448ff80 commit eb9fbb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/gui/confirmation_panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func (gui *Gui) createPopupPanel(opts types.CreatePopupPanelOpts) error {
textArea := confirmationView.TextArea
textArea.Clear()
textArea.TypeString(opts.Prompt)
gui.resizeConfirmationPanel()
confirmationView.RenderTextArea()
} else {
if err := gui.renderString(confirmationView, style.AttrBold.Sprint(opts.Prompt)); err != nil {
Expand Down
6 changes: 5 additions & 1 deletion pkg/gui/view_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ func (gui *Gui) resizeConfirmationPanel() {
}
panelWidth := gui.getConfirmationPanelWidth()
prompt := gui.Views.Confirmation.Buffer()
wrap := !gui.Views.Confirmation.Editable
wrap := true
if gui.Views.Confirmation.Editable {
prompt = gui.Views.Confirmation.TextArea.GetContent()
wrap = false
}
panelHeight := gui.getMessageHeight(wrap, prompt, panelWidth) + suggestionsViewHeight
x0, y0, x1, y1 := gui.getConfirmationPanelDimensionsAux(panelWidth, panelHeight)
confirmationViewBottom := y1 - suggestionsViewHeight
Expand Down

0 comments on commit eb9fbb0

Please sign in to comment.