From 204a763dffc6168e804dd6d7254acb501bb2d8c9 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 2 Aug 2016 09:45:41 -0400 Subject: [PATCH] Remove backspace prompt cancelation Fixes #202 --- cmd/micro/messenger.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/micro/messenger.go b/cmd/micro/messenger.go index 7715ccfd..36495501 100644 --- a/cmd/micro/messenger.go +++ b/cmd/micro/messenger.go @@ -204,11 +204,6 @@ func (m *Messenger) Prompt(prompt, historyType string, completionType Completion } m.HandleEvent(event, m.history[historyType]) - - if m.cursorx < 0 { - // Cancel - m.hasPrompt = false - } } m.Reset() @@ -243,8 +238,8 @@ func (m *Messenger) HandleEvent(event tcell.Event, history []string) { case tcell.KeyBackspace2, tcell.KeyBackspace: if m.cursorx > 0 { m.response = string([]rune(m.response)[:m.cursorx-1]) + string(m.response[m.cursorx:]) + m.cursorx-- } - m.cursorx-- case tcell.KeyRune: m.response = Insert(m.response, m.cursorx, string(e.Rune())) m.cursorx++