mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-08 16:12:09 -07:00
@@ -316,7 +316,9 @@ const (
|
||||
actPreviewHalfPageUp
|
||||
actPreviewHalfPageDown
|
||||
actPrevHistory
|
||||
actPrevSelected
|
||||
actNextHistory
|
||||
actNextSelected
|
||||
actExecute
|
||||
actExecuteSilent
|
||||
actExecuteMulti // Deprecated
|
||||
@@ -3016,6 +3018,22 @@ func (t *Terminal) Loop() {
|
||||
scrollPreviewTo(t.evaluateScrollOffset())
|
||||
}
|
||||
}
|
||||
case actNextSelected, actPrevSelected:
|
||||
if len(t.selected) > 0 {
|
||||
total := t.merger.Length()
|
||||
for i := 1; i < total; i++ {
|
||||
y := (t.cy + i) % total
|
||||
if t.layout == layoutDefault && a.t == actNextSelected ||
|
||||
t.layout != layoutDefault && a.t == actPrevSelected {
|
||||
y = (t.cy - i + total) % total
|
||||
}
|
||||
if _, found := t.selected[t.merger.Get(y).item.Index()]; found {
|
||||
t.vset(y)
|
||||
req(reqList)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user