share/share-codemirror — pull request #6 by domagojk (2014-12-02 00:11:23+00:00)
Title: Update share-codemirror.js

Using a current implementation of sharejs with codemirror, multiple cursors are not working.
This is because change event is fireing AFTER it has been applied in codemirror document. For this reason, it is not good to rely on cm.lineinfo() since it may contain characters that are not inserted in sharejs ctx.
Calculating position index from ctx.get() does the trick and with it, you can safely use codemirrors multiple cursors.
("indexFromPos" is a function derived from codemirror lib)