diff options
-rw-r--r-- | js/codeq/prolog.js | 13 | ||||
-rw-r--r-- | js/codeq/python.js | 13 | ||||
-rw-r--r-- | js/codeq/robot.js | 13 |
3 files changed, 24 insertions, 15 deletions
diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js index d9b76d1..ef7a089 100644 --- a/js/codeq/prolog.js +++ b/js/codeq/prolog.js @@ -234,14 +234,17 @@ editor.on('change', function (instance, changeObj) { var doc = editor.getDoc(), - pos = codeq.codePointCount(doc.getRange(firstCharacterPos, changeObj.from)); + pos = codeq.codePointCount(doc.getRange(firstCharacterPos, changeObj.from)), + text; - if (changeObj.removed) { - activityHandler.queueTrace({'typ': 'rm', 'off': pos, 'len': codeq.codePointCount(changeObj.removed.join(''))}); + text = changeObj.removed.join('\n'); + if (text) { + activityHandler.queueTrace({'typ': 'rm', 'off': pos, 'txt': text}); } - if (changeObj.text) { - activityHandler.queueTrace({'typ': 'ins', 'off': pos, 'txt': changeObj.text}); + text = changeObj.text.join('\n'); + if (text) { + activityHandler.queueTrace({'typ': 'ins', 'off': pos, 'txt': text}); } }); diff --git a/js/codeq/python.js b/js/codeq/python.js index 4254d8c..e67ec09 100644 --- a/js/codeq/python.js +++ b/js/codeq/python.js @@ -192,14 +192,17 @@ editor.on('change', function (instance, changeObj) { var doc = editor.getDoc(), - pos = codeq.codePointCount(doc.getRange(firstCharacterPos, changeObj.from)); + pos = codeq.codePointCount(doc.getRange(firstCharacterPos, changeObj.from)), + text; - if (changeObj.removed) { - activityHandler.queueTrace({'typ': 'rm', 'off': pos, 'len': codeq.codePointCount(changeObj.removed.join(''))}); + text = changeObj.removed.join('\n'); + if (text) { + activityHandler.queueTrace({'typ': 'rm', 'off': pos, 'txt': text}); } - if (changeObj.text) { - activityHandler.queueTrace({'typ': 'ins', 'off': pos, 'txt': changeObj.text}); + text = changeObj.text.join('\n'); + if (text) { + activityHandler.queueTrace({'typ': 'ins', 'off': pos, 'txt': text}); } }); diff --git a/js/codeq/robot.js b/js/codeq/robot.js index 8854855..11b91cf 100644 --- a/js/codeq/robot.js +++ b/js/codeq/robot.js @@ -146,14 +146,17 @@ editor.on('change', function (instance, changeObj) { var doc = editor.getDoc(), - pos = codeq.codePointCount(doc.getRange(firstCharacterPos, changeObj.from)); + pos = codeq.codePointCount(doc.getRange(firstCharacterPos, changeObj.from)), + text; - if (changeObj.removed) { - activityHandler.queueTrace({'typ': 'rm', 'off': pos, 'len': codeq.codePointCount(changeObj.removed.join(''))}); + text = changeObj.removed.join('\n'); + if (text) { + activityHandler.queueTrace({'typ': 'rm', 'off': pos, 'txt': text}); } - if (changeObj.text) { - activityHandler.queueTrace({'typ': 'ins', 'off': pos, 'txt': changeObj.text}); + text = changeObj.text.join('\n'); + if (text) { + activityHandler.queueTrace({'typ': 'ins', 'off': pos, 'txt': text}); } }); |