summaryrefslogtreecommitdiffstats
path: root/pkg/gui/confirmation_panel.go
diff options
context:
space:
mode:
authorMark Kopenga <mkopenga@gmail.com>2018-12-06 08:31:12 +0100
committerGitHub <noreply@github.com>2018-12-06 08:31:12 +0100
commit1b6d34e76a4d5d132f95072139fb3aba760eb771 (patch)
treefb6cc607a67f0d3d2ef0b9d66fafd439864e6d9a /pkg/gui/confirmation_panel.go
parent67115436347dec591d12a1a31d1c971915cf0b05 (diff)
parent1a6a69a8f1f7c44978a384ba56321149f973223d (diff)
Merge branch 'master' into https-ask-for-username-password
Diffstat (limited to 'pkg/gui/confirmation_panel.go')
-rw-r--r--pkg/gui/confirmation_panel.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go
index 0961370b8..75349777c 100644
--- a/pkg/gui/confirmation_panel.go
+++ b/pkg/gui/confirmation_panel.go
@@ -8,6 +8,7 @@ package gui
import (
"strings"
+ "time"
"github.com/fatih/color"
"github.com/jesseduffield/gocui"
@@ -73,6 +74,7 @@ func (gui *Gui) prepareConfirmationPanel(currentView *gocui.View, title, prompt
return nil, err
}
confirmationView.Title = title
+ confirmationView.Wrap = true
confirmationView.FgColor = gocui.ColorWhite
}
confirmationView.Clear()
@@ -138,7 +140,15 @@ func (gui *Gui) createMessagePanel(g *gocui.Gui, currentView *gocui.View, title,
}
func (gui *Gui) createErrorPanel(g *gocui.Gui, message string) error {
- gui.Log.Error(message)
+ go func() {
+ // when reporting is switched on this log call sometimes introduces
+ // a delay on the error panel popping up. Here I'm adding a second wait
+ // so that the error is logged while the user is reading the error message
+ time.Sleep(time.Second)
+ gui.Log.Error(message)
+ }()
+
+ // gui.Log.WithField("staging", "staging").Info("creating confirmation panel")
currentView := g.CurrentView()
colorFunction := color.New(color.FgRed).SprintFunc()
coloredMessage := colorFunction(strings.TrimSpace(message))