summaryrefslogtreecommitdiff
path: root/js/codeq/prolog.js
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-10-05 12:07:26 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-10-05 12:07:26 +0200
commit495088ec00f711f576612e0c3db1fec649134c83 (patch)
tree6fd7e379f786fee17746ba7b62fb534d375fad84 /js/codeq/prolog.js
parent30f1dc178a3554a5d468ae9b78ba71cf9eeab63b (diff)
Fix editor activity reporting
Diffstat (limited to 'js/codeq/prolog.js')
-rw-r--r--js/codeq/prolog.js13
1 files changed, 8 insertions, 5 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});
}
});