From 8f4a8553dd1ce99cee833ff4a76c1c8deb696b5d Mon Sep 17 00:00:00 2001 From: Tobias Hintze Date: Tue, 13 Nov 2012 01:43:28 +0100 Subject: [PATCH] Document: add comment about incorrect cursor-handling in insertText --- webodf/lib/ops/Document.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webodf/lib/ops/Document.js b/webodf/lib/ops/Document.js index fb7b1f6e..34c8a1f9 100644 --- a/webodf/lib/ops/Document.js +++ b/webodf/lib/ops/Document.js @@ -271,6 +271,14 @@ ops.Document = function Document(odfCanvas) { domPosition = getPositionInTextNode(position); if (domPosition) { domPosition.textNode.insertData(domPosition.offset, text); + // FIXME care must be taken regarding the cursor positions + // the new text must appear in front of the (own) cursor. + // if there are/were other cursors at the same address, + // those must not move along. + // conclusion: insert text BEHIND ALL CURSORS, then move + // the `memberid`-cursor behind new text; alternatively + // move `memberid`-cursor behind all cursors at the same + // position. then insert text before `memberid`-cursor. highlightEdit(getParagraphElement(domPosition.textNode), memberid); return true; }