Fix history clear

This commit is contained in:
c-bata 2017-08-04 20:33:28 +09:00
parent bdc32514f8
commit e7a5a474ef

View File

@ -10,12 +10,12 @@ type History struct {
func (h *History) Add(input string) {
h.histories = append(h.histories, input)
copy(h.tmp, h.histories)
h.tmp = append(h.tmp, "")
h.selected = len(h.tmp) - 1
h.Clear()
}
func (h *History) Clear() {
copy(h.tmp, h.histories)
h.tmp = append(h.tmp, "")
h.selected = len(h.tmp) - 1
}