From 13330738b8f8bd157e6c75c00172022636fc3422 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 18 May 2016 22:45:34 +0900 Subject: [PATCH] Do not match jump labels beyond the screen limit --- src/terminal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/terminal.go b/src/terminal.go index 4f611ebe..c4402926 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -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)