diff --git a/js/main.js b/js/main.js index d619d19..944c200 100644 --- a/js/main.js +++ b/js/main.js @@ -159,7 +159,7 @@ function handleDelete(event) { function handleEnter(event) { let pos = editor.getCursor(); - if (pos.line < editor.doc.size) { + if (pos.line < editor.doc.size - 1) { let currentLine = editor.doc.getLine(pos.line); let trimmed = currentLine.trim(); if (editor.getCursor().ch >= currentLine.indexOf(trimmed) + trimmed.length) {