From eb9fbb0a33caecf4186a7db4ce984db22abbd596 Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Thu, 1 Sep 2022 19:31:40 +0900 Subject: [PATCH] fix(confirmation_panel.go): fix initial origin of editor box --- pkg/gui/confirmation_panel.go | 1 + pkg/gui/view_helpers.go | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go index 16bc551be..b8f79c8a2 100644 --- a/pkg/gui/confirmation_panel.go +++ b/pkg/gui/confirmation_panel.go @@ -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 { diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 713639251..db4fe476d 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -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