mirror of
https://github.com/junegunn/fzf.git
synced 2026-09-21 19:23:19 +08:00
'reload' should not preserve multi-selection
This commit is contained in:
+5
-3
@@ -1858,8 +1858,8 @@ func (t *Terminal) UpdateList(result MatchResult) {
|
|||||||
}
|
}
|
||||||
if t.revision != newRevision {
|
if t.revision != newRevision {
|
||||||
if !t.revision.compatible(newRevision) {
|
if !t.revision.compatible(newRevision) {
|
||||||
// Reloaded: capture selection keys for restoration, then clear
|
// Reloaded: capture selection keys for restoration, then clear (reload-sync only)
|
||||||
if len(t.idNth) > 0 && t.multi > 0 && len(t.selected) > 0 {
|
if t.trackSync && len(t.idNth) > 0 && t.multi > 0 && len(t.selected) > 0 {
|
||||||
t.pendingSelections = make(map[string]selectedItem, len(t.selected))
|
t.pendingSelections = make(map[string]selectedItem, len(t.selected))
|
||||||
for _, sel := range t.selected {
|
for _, sel := range t.selected {
|
||||||
key := t.trackKeyFor(sel.item, t.idNth)
|
key := t.trackKeyFor(sel.item, t.idNth)
|
||||||
@@ -7482,13 +7482,15 @@ func (t *Terminal) Loop() error {
|
|||||||
reloadSync = a.t == actReloadSync
|
reloadSync = a.t == actReloadSync
|
||||||
t.reading = true
|
t.reading = true
|
||||||
|
|
||||||
|
if len(t.idNth) > 0 {
|
||||||
|
t.trackSync = reloadSync
|
||||||
|
}
|
||||||
// Capture tracking key before reload
|
// Capture tracking key before reload
|
||||||
if !t.track.Disabled() && len(t.idNth) > 0 {
|
if !t.track.Disabled() && len(t.idNth) > 0 {
|
||||||
if item := t.currentItem(); item != nil {
|
if item := t.currentItem(); item != nil {
|
||||||
t.trackKey = t.trackKeyFor(item, t.idNth)
|
t.trackKey = t.trackKeyFor(item, t.idNth)
|
||||||
t.trackKeyCache = make(map[int32]bool)
|
t.trackKeyCache = make(map[int32]bool)
|
||||||
t.trackBlocked = true
|
t.trackBlocked = true
|
||||||
t.trackSync = reloadSync
|
|
||||||
if !t.inputless {
|
if !t.inputless {
|
||||||
t.tui.HideCursor()
|
t.tui.HideCursor()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user