summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2022-09-01 19:31:40 +0900
committerRyooooooga <eial5q265e5@gmail.com>2022-09-01 19:44:17 +0900
commiteb9fbb0a33caecf4186a7db4ce984db22abbd596 (patch)
treeb88c6b8ea422d1ff9d7a6758c37d90fe4d8caf1f /pkg
parent448ff80d7d7a75f439b46ce4068615ea02764df5 (diff)
fix(confirmation_panel.go): fix initial origin of editor box
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/confirmation_panel.go1
-rw-r--r--pkg/gui/view_helpers.go6
2 files changed, 6 insertions, 1 deletions
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