diff --git a/lib/ace/ext/error_marker.js b/lib/ace/ext/error_marker.js index 05d50498..5dbe3d2e 100644 --- a/lib/ace/ext/error_marker.js +++ b/lib/ace/ext/error_marker.js @@ -62,7 +62,7 @@ function findAnnotations(session, row, dir) { if (i < 0) i = -i - 1; - if (i >= annotations.length - 1) + if (i >= annotations.length) i = dir > 0 ? 0 : annotations.length - 1; else if (i === 0 && dir < 0) i = annotations.length - 1;