diff --git a/cmd/micro/messenger.go b/cmd/micro/messenger.go index b57d7ff1..b53687b1 100644 --- a/cmd/micro/messenger.go +++ b/cmd/micro/messenger.go @@ -98,6 +98,7 @@ func (m *Messenger) Error(msg ...interface{}) { // YesNoPrompt asks the user a yes or no question (waits for y or n) and returns the result func (m *Messenger) YesNoPrompt(prompt string) (bool, bool) { + m.hasPrompt = true m.Message(prompt) _, h := screen.Size() @@ -126,6 +127,7 @@ func (m *Messenger) YesNoPrompt(prompt string) (bool, bool) { // LetterPrompt gives the user a prompt and waits for a one letter response func (m *Messenger) LetterPrompt(prompt string, responses ...rune) (rune, bool) { + m.hasPrompt = true m.Message(prompt) _, h := screen.Size() @@ -347,14 +349,14 @@ func (m *Messenger) DisplaySuggestions(suggestions []string) { func (m *Messenger) Display() { _, h := screen.Size() if m.hasMessage { - if !m.hasPrompt && !globalSettings["infobar"].(bool) { - return - } - runes := []rune(m.message + m.response) - for x := 0; x < len(runes); x++ { - screen.SetContent(x, h-1, runes[x], nil, m.style) + if m.hasPrompt || globalSettings["infobar"].(bool) { + runes := []rune(m.message + m.response) + for x := 0; x < len(runes); x++ { + screen.SetContent(x, h-1, runes[x], nil, m.style) + } } } + if m.hasPrompt { screen.ShowCursor(Count(m.message)+m.cursorx, h-1) screen.Show() diff --git a/cmd/micro/micro.go b/cmd/micro/micro.go index 8f4de132..34b49ca1 100644 --- a/cmd/micro/micro.go +++ b/cmd/micro/micro.go @@ -360,7 +360,7 @@ func main() { // If the user left clicked we check a couple things _, h := screen.Size() x, y := e.Position() - if y == h-1 && messenger.message != "" { + if y == h-1 && messenger.message != "" && globalSettings["infobar"].(bool) { // If the user clicked in the bottom bar, and there is a message down there // we copy it to the clipboard. // Often error messages are displayed down there so it can be useful to easily