Allow a pad to only end with a single newline, rather than requiring two.

This commit is contained in:
Xavid 2015-06-19 14:02:18 -04:00
parent ef5e62e3a1
commit 0713553906

View file

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