summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-05-18 22:45:34 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-05-18 22:45:34 +0900
commit13330738b8f8bd157e6c75c00172022636fc3422 (patch)
tree34cca89dbdbeccbbcb072b7b8cc9d4766276982f /src
parente53535cc61e67ed58f281c943786ba84e1aeef9c (diff)
Do not match jump labels beyond the screen limit
Diffstat (limited to 'src')
-rw-r--r--src/terminal.go2
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)