Merge pull request #2696 from xavidotron/develop
Allow a pad to end with only a single newline.
This commit is contained in:
commit
23bcccdf80
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3384,7 +3384,7 @@ function Ace2Inner(){
|
||||||
renumberList(lineNum + 1);//trigger renumbering of list that may be right after
|
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');
|
performDocumentReplaceSelection('\n');
|
||||||
setLineListType(lineNum + 1, type+level);
|
setLineListType(lineNum + 1, type+level);
|
||||||
|
|
Loading…
Reference in New Issue