From 4313bd27f84d29c604d593a69bd09aee5189b290 Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Sun, 15 Feb 2015 13:25:57 +0100 Subject: [PATCH] add a comment to make clear that the string in stringIterator does not change; only curIndex is increased. Newlines are counted between curIndex and the end of string. --- src/static/js/Changeset.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/static/js/Changeset.js b/src/static/js/Changeset.js index fd658f869..a7ae8e713 100644 --- a/src/static/js/Changeset.js +++ b/src/static/js/Changeset.js @@ -507,6 +507,7 @@ exports.opAssembler = function () { */ exports.stringIterator = function (str) { var curIndex = 0; + // newLines is the number of \n between curIndex and str.length var newLines = str.split("\n").length - 1 function getnewLines(){ return newLines