Fix history clear
This commit is contained in:
parent
bdc32514f8
commit
e7a5a474ef
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user