diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2016-05-18 22:45:34 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2016-05-18 22:45:34 +0900 |
commit | 13330738b8f8bd157e6c75c00172022636fc3422 (patch) | |
tree | 34cca89dbdbeccbbcb072b7b8cc9d4766276982f | |
parent | e53535cc61e67ed58f281c943786ba84e1aeef9c (diff) |
Do not match jump labels beyond the screen limit
-rw-r--r-- | src/terminal.go | 2 |
1 files changed, 1 insertions, 1 deletions
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) |