Do not match jump labels beyond the screen limit

pull/581/head
Junegunn Choi 8 years ago
parent e53535cc61
commit 13330738b8
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -1155,7 +1155,7 @@ func (t *Terminal) Loop() {
changed = string(previousInput) != string(t.input)
} else {
if mapkey == C.Rune {
if idx := strings.IndexRune(t.jumpLabels, event.Char); idx >= 0 {
if idx := strings.IndexRune(t.jumpLabels, event.Char); idx >= 0 && idx < t.maxItems() && idx < t.merger.Length() {
t.cy = idx + t.offset
if t.jumping == jumpAcceptEnabled {
req(reqClose)

Loading…
Cancel
Save