Fix panic when replace-query is triggered on empty result set

pull/1172/head
Junegunn Choi 7 years ago
parent 04aa2992e7
commit 9c47739c0e
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -1571,7 +1571,7 @@ func (t *Terminal) Loop() {
case actPrintQuery:
req(reqPrintQuery)
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.cx = len(t.input)
}

Loading…
Cancel
Save