mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 22:27:13 +09:00
Use byte slice for insert
This commit is contained in:
@@ -64,7 +64,7 @@ func (i *InfoBuf) SaveHistory() {
|
||||
func (i *InfoBuf) UpHistory(history []string) {
|
||||
if i.HistoryNum > 0 {
|
||||
i.HistoryNum--
|
||||
i.Replace(i.Start(), i.End(), history[i.HistoryNum])
|
||||
i.Replace(i.Start(), i.End(), []byte(history[i.HistoryNum]))
|
||||
i.Buffer.GetActiveCursor().GotoLoc(i.End())
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ func (i *InfoBuf) UpHistory(history []string) {
|
||||
func (i *InfoBuf) DownHistory(history []string) {
|
||||
if i.HistoryNum < len(history)-1 {
|
||||
i.HistoryNum++
|
||||
i.Replace(i.Start(), i.End(), history[i.HistoryNum])
|
||||
i.Replace(i.Start(), i.End(), []byte(history[i.HistoryNum]))
|
||||
i.Buffer.GetActiveCursor().GotoLoc(i.End())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user