diff --git a/pkg/gui/controllers/helpers/confirmation_helper.go b/pkg/gui/controllers/helpers/confirmation_helper.go index cc06e03af..d96159aea 100644 --- a/pkg/gui/controllers/helpers/confirmation_helper.go +++ b/pkg/gui/controllers/helpers/confirmation_helper.go @@ -25,14 +25,6 @@ func NewConfirmationHelper(c *HelperCommon) *ConfirmationHelper { // keybindings. func (self *ConfirmationHelper) closeAndCallConfirmationFunction(cancel goContext.CancelFunc, function func() error) error { - if self.c.GocuiGui().IsPasting { - // The user is pasting multi-line text into a prompt; we don't want to handle the - // line feeds as "confirm" keybindings. Simply ignoring them is the best we can do; this - // will cause the entire pasted text to appear as a single line in the prompt. Hopefully - // the user knows that ctrl-u allows them to delete it again... - return nil - } - cancel() self.c.Context().Pop() @@ -54,6 +46,14 @@ func (self *ConfirmationHelper) wrappedConfirmationFunction(cancel goContext.Can func (self *ConfirmationHelper) wrappedPromptConfirmationFunction(cancel goContext.CancelFunc, function func(string) error, getResponse func() string) func() error { return func() error { + if self.c.GocuiGui().IsPasting { + // The user is pasting multi-line text into a prompt; we don't want to handle the + // line feeds as "confirm" keybindings. Simply ignoring them is the best we can do; this + // will cause the entire pasted text to appear as a single line in the prompt. Hopefully + // the user knows that ctrl-u allows them to delete it again... + return nil + } + return self.closeAndCallConfirmationFunction(cancel, func() error { return function(getResponse()) })