Defer resetting multi-selection on reload

This commit is contained in:
Junegunn Choi
2019-12-09 21:32:58 +09:00
parent af1a5f130b
commit 2b725a4db5
4 changed files with 41 additions and 10 deletions

View File

@@ -495,10 +495,13 @@ func (t *Terminal) UpdateProgress(progress float32) {
}
// UpdateList updates Merger to display the list
func (t *Terminal) UpdateList(merger *Merger) {
func (t *Terminal) UpdateList(merger *Merger, reset bool) {
t.mutex.Lock()
t.progress = 100
t.merger = merger
if reset {
t.selected = make(map[int32]selectedItem)
}
t.mutex.Unlock()
t.reqBox.Set(reqInfo, nil)
t.reqBox.Set(reqList, nil)
@@ -2068,7 +2071,6 @@ func (t *Terminal) Loop() {
command := replacePlaceholder(a.a,
t.ansi, t.delimiter, t.printsep, false, string(t.input), list)
newCommand = &command
t.selected = make(map[int32]selectedItem)
}
}
return true