From 1a710272f85c89fc05fee3e3ebdf14ceda7a8f3e Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 15 Jan 2019 23:11:03 -0500 Subject: [PATCH] Prompt trim fix --- cmd/micro/action/infohandler.go | 4 +--- cmd/micro/info/infobuffer.go | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/micro/action/infohandler.go b/cmd/micro/action/infohandler.go index 11347960..5c432295 100644 --- a/cmd/micro/action/infohandler.go +++ b/cmd/micro/action/infohandler.go @@ -1,8 +1,6 @@ package action import ( - "strings" - "github.com/zyedidia/micro/cmd/micro/display" "github.com/zyedidia/micro/cmd/micro/info" "github.com/zyedidia/tcell" @@ -48,7 +46,7 @@ func (h *InfoHandler) HandleEvent(event tcell.Event) { done = true } if done && h.HasPrompt && !hasYN { - resp := strings.TrimSpace(string(h.LineBytes(0))) + resp := string(h.LineBytes(0)) hist := h.History[h.PromptType] hist[h.HistoryNum] = resp if h.EventCallback != nil { diff --git a/cmd/micro/info/infobuffer.go b/cmd/micro/info/infobuffer.go index cd6d4d4c..26cada21 100644 --- a/cmd/micro/info/infobuffer.go +++ b/cmd/micro/info/infobuffer.go @@ -2,7 +2,6 @@ package info import ( "fmt" - "strings" "github.com/zyedidia/micro/cmd/micro/buffer" ) @@ -140,7 +139,7 @@ func (i *InfoBuf) DonePrompt(canceled bool) { h := i.History[i.PromptType] i.History[i.PromptType] = h[:len(h)-1] } else { - resp := strings.TrimSpace(string(i.LineBytes(0))) + resp := string(i.LineBytes(0)) i.PromptCallback(resp, false) h := i.History[i.PromptType] h[len(h)-1] = resp