Fix enter working in the middle of lines

This commit is contained in:
Shadowfacts 2016-09-28 18:50:24 -04:00
parent b770fd1101
commit 9bc15fbbdf
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ document.addEventListener("keydown", (event) => {
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) {
if (editor.getCursor().ch >= currentLine.indexOf(trimmed) + trimmed.length) {
let newLine = pos.line + 1;
let text = editor.doc.getLine(newLine);
let ch = text.indexOf(text.trim());