mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-22 04:45:14 +00:00
parent
ff1687744d
commit
82ebcd9209
@ -4410,17 +4410,32 @@ func (t *Terminal) Loop() error {
|
|||||||
suffix := copySlice(t.input[t.cx:])
|
suffix := copySlice(t.input[t.cx:])
|
||||||
t.input = append(append(t.input[:t.cx], t.yanked...), suffix...)
|
t.input = append(append(t.input[:t.cx], t.yanked...), suffix...)
|
||||||
t.cx += len(t.yanked)
|
t.cx += len(t.yanked)
|
||||||
case actPageUp:
|
case actPageUp, actPageDown, actHalfPageUp, actHalfPageDown:
|
||||||
t.vmove(t.maxItems()-1, false)
|
maxItems := t.maxItems()
|
||||||
req(reqList)
|
linesToMove := maxItems - 1
|
||||||
case actPageDown:
|
if a.t == actHalfPageUp || a.t == actHalfPageDown {
|
||||||
t.vmove(-(t.maxItems() - 1), false)
|
linesToMove = maxItems / 2
|
||||||
req(reqList)
|
}
|
||||||
case actHalfPageUp:
|
|
||||||
t.vmove(t.maxItems()/2, false)
|
direction := -1
|
||||||
req(reqList)
|
if a.t == actPageUp || a.t == actHalfPageUp {
|
||||||
case actHalfPageDown:
|
direction = 1
|
||||||
t.vmove(-(t.maxItems() / 2), false)
|
}
|
||||||
|
|
||||||
|
for linesToMove > 0 {
|
||||||
|
currentItem := t.currentItem()
|
||||||
|
if currentItem == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
itemLines, _ := t.numItemLines(currentItem, maxItems)
|
||||||
|
linesToMove -= itemLines
|
||||||
|
cy := t.cy
|
||||||
|
t.vmove(direction, false)
|
||||||
|
if cy == t.cy {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
req(reqList)
|
req(reqList)
|
||||||
case actOffsetUp, actOffsetDown:
|
case actOffsetUp, actOffsetDown:
|
||||||
diff := 1
|
diff := 1
|
||||||
|
Loading…
Reference in New Issue
Block a user