Use byte slice for insert

This commit is contained in:
Zachary Yedidia
2019-01-14 22:29:24 -05:00
parent 812c7761dc
commit 1563ab93dd
7 changed files with 22 additions and 22 deletions

View File

@@ -111,7 +111,7 @@ func (i *InfoBuf) Prompt(prompt string, msg string, ptype string, eventcb func(s
i.HasGutter = false
i.PromptCallback = donecb
i.EventCallback = eventcb
i.Buffer.Insert(i.Buffer.Start(), msg)
i.Buffer.Insert(i.Buffer.Start(), []byte(msg))
}
func (i *InfoBuf) YNPrompt(prompt string, donecb func(bool, bool)) {
@@ -151,7 +151,7 @@ func (i *InfoBuf) DonePrompt(canceled bool) {
i.PromptCallback = nil
i.EventCallback = nil
i.YNCallback = nil
i.Replace(i.Start(), i.End(), "")
i.Replace(i.Start(), i.End(), []byte{})
}
// Reset resets the infobuffer's msg and info