mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-26 06:46:35 +00:00
Fix panic when replace-query is triggered on empty result set
This commit is contained in:
parent
04aa2992e7
commit
9c47739c0e
@ -1571,7 +1571,7 @@ func (t *Terminal) Loop() {
|
|||||||
case actPrintQuery:
|
case actPrintQuery:
|
||||||
req(reqPrintQuery)
|
req(reqPrintQuery)
|
||||||
case actReplaceQuery:
|
case actReplaceQuery:
|
||||||
if t.cy < t.merger.Length() {
|
if t.cy >= 0 && t.cy < t.merger.Length() {
|
||||||
t.input = t.merger.Get(t.cy).item.text.ToRunes()
|
t.input = t.merger.Get(t.cy).item.text.ToRunes()
|
||||||
t.cx = len(t.input)
|
t.cx = len(t.input)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user