From 0713553906bee57c289d13f61b192da4eceac143 Mon Sep 17 00:00:00 2001 From: Xavid Date: Fri, 19 Jun 2015 14:02:18 -0400 Subject: Allow a pad to only end with a single newline, rather than requiring two. --- src/node/handler/PadMessageHandler.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/node/handler/PadMessageHandler.js') diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 9a0d1ee7..0172400b 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -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); } -- cgit v1.2.3