Fix being able to skip the last line

This commit is contained in:
Shadowfacts 2016-10-01 17:51:22 -04:00
parent 019e985587
commit a15d47d4e5
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 6 additions and 6 deletions

View File

@ -159,10 +159,10 @@ function handleDelete(event) {
function handleEnter(event) { function handleEnter(event) {
let pos = editor.getCursor(); let pos = editor.getCursor();
if (pos.line < editor.doc.size - 1) {
let currentLine = editor.doc.getLine(pos.line); let currentLine = editor.doc.getLine(pos.line);
let trimmed = currentLine.trim(); let trimmed = currentLine.trim();
if (editor.getCursor().ch >= currentLine.indexOf(trimmed) + trimmed.length) { if (editor.getCursor().ch >= currentLine.indexOf(trimmed) + trimmed.length) {
if (pos.line < editor.doc.size - 1) {
var newLine = pos.line; var newLine = pos.line;
while (true) { while (true) {
newLine++; newLine++;
@ -181,10 +181,10 @@ function handleEnter(event) {
} }
updateIncompleteMark(); updateIncompleteMark();
save(); save();
}
} else { } else {
goToNextChunk(); goToNextChunk();
} }
}
} }
function moveToEndOfPreviousLine() { function moveToEndOfPreviousLine() {