mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 18:06:15 -04:00
Merge pull request #2649 from xavidotron/develop
When using setText(), replace the entire existing text of the pad.
This commit is contained in:
commit
ee0368fd0f
4 changed files with 10 additions and 10 deletions
|
@ -260,13 +260,13 @@ exports.checkRep = function (cs) {
|
|||
break;
|
||||
case '-':
|
||||
oldPos += o.chars;
|
||||
exports.assert(oldPos < oldLen, oldPos, " >= ", oldLen, " in ", cs);
|
||||
exports.assert(oldPos <= oldLen, oldPos, " > ", oldLen, " in ", cs);
|
||||
break;
|
||||
case '+':
|
||||
{
|
||||
calcNewLen += o.chars;
|
||||
numInserted += o.chars;
|
||||
exports.assert(calcNewLen < newLen, calcNewLen, " >= ", newLen, " in ", cs);
|
||||
exports.assert(calcNewLen <= newLen, calcNewLen, " > ", newLen, " in ", cs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1408,8 +1408,8 @@ exports.makeSplice = function (oldFullText, spliceStart, numRemoved, newText, op
|
|||
if (spliceStart >= oldLen) {
|
||||
spliceStart = oldLen - 1;
|
||||
}
|
||||
if (numRemoved > oldFullText.length - spliceStart - 1) {
|
||||
numRemoved = oldFullText.length - spliceStart - 1;
|
||||
if (numRemoved > oldFullText.length - spliceStart) {
|
||||
numRemoved = oldFullText.length - spliceStart;
|
||||
}
|
||||
var oldText = oldFullText.substring(spliceStart, spliceStart + numRemoved);
|
||||
var newLen = oldLen + newText.length - oldText.length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue