Merge pull request #2696 from xavidotron/develop

Allow a pad to end with only a single newline.
This commit is contained in:
John McLear 2015-06-20 13:54:37 +01:00
commit 23bcccdf80
2 changed files with 4 additions and 3 deletions

View File

@ -773,8 +773,9 @@ function handleUserChanges(data, cb)
}
// Make sure the pad always ends with an empty line.
if (pad.text().lastIndexOf("\n\n") != pad.text().length-2) {
var nlChangeset = Changeset.makeSplice(pad.text(), pad.text().length-1, 0, "\n");
if (pad.text().lastIndexOf("\n") != pad.text().length-1) {
var nlChangeset = Changeset.makeSplice(pad.text(), pad.text().length-1,
0, "\n");
pad.appendRevision(nlChangeset);
}

View File

@ -3384,7 +3384,7 @@ function Ace2Inner(){
renumberList(lineNum + 1);//trigger renumbering of list that may be right after
}
}
else if (lineNum + 1 < rep.lines.length())
else if (lineNum + 1 <= rep.lines.length())
{
performDocumentReplaceSelection('\n');
setLineListType(lineNum + 1, type+level);