Allow a pad to only end with a single newline, rather than requiring two.
parent
ef5e62e3a1
commit
0713553906
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue