mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-14 14:23:47 -05:00
Refactor action implementation
This commit is contained in:
@@ -6088,32 +6088,22 @@ func (t *Terminal) Loop() error {
|
|||||||
t.vmove(1, true)
|
t.vmove(1, true)
|
||||||
req(reqList)
|
req(reqList)
|
||||||
}
|
}
|
||||||
case actDown, actDownMatch:
|
case actDown, actDownMatch, actUp, actUpMatch:
|
||||||
if t.raw && a.t == actDownMatch {
|
dir := -1
|
||||||
|
if a.t == actUp || a.t == actUpMatch {
|
||||||
|
dir = 1
|
||||||
|
}
|
||||||
|
if t.raw && (a.t == actDownMatch || a.t == actUpMatch) {
|
||||||
if t.resultMerger.Length() > 0 {
|
if t.resultMerger.Length() > 0 {
|
||||||
prevCy := t.cy
|
prevCy := t.cy
|
||||||
for t.vmove(-1, true) && !t.isCurrentItemMatch() {
|
for t.vmove(dir, true) && !t.isCurrentItemMatch() {
|
||||||
}
|
}
|
||||||
if !t.isCurrentItemMatch() {
|
if !t.isCurrentItemMatch() {
|
||||||
t.vset(prevCy)
|
t.vset(prevCy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
t.vmove(-1, true)
|
t.vmove(dir, true)
|
||||||
}
|
|
||||||
req(reqList)
|
|
||||||
case actUp, actUpMatch:
|
|
||||||
if t.raw && a.t == actUpMatch {
|
|
||||||
if t.resultMerger.Length() > 0 {
|
|
||||||
prevCy := t.cy
|
|
||||||
for t.vmove(1, true) && !t.isCurrentItemMatch() {
|
|
||||||
}
|
|
||||||
if !t.isCurrentItemMatch() {
|
|
||||||
t.vset(prevCy)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
t.vmove(1, true)
|
|
||||||
}
|
}
|
||||||
req(reqList)
|
req(reqList)
|
||||||
case actToggleRaw:
|
case actToggleRaw:
|
||||||
|
|||||||
Reference in New Issue
Block a user