Skip to content

Support multiple simultaneous CodeMirror edits#100

Open
edemaine wants to merge 1 commit intomizzao:masterfrom
edemaine:multiedit
Open

Support multiple simultaneous CodeMirror edits#100
edemaine wants to merge 1 commit intomizzao:masterfrom
edemaine:multiedit

Conversation

@edemaine
Copy link

@edemaine edemaine commented Apr 27, 2019

CodeMirror can stage multiple edits at once, for example, using multiple cursors (ctrl-click), or updating many numbers at once in Markdown, or hitting newline before some whitespace at the end of the line. These multiple updates need to be handled with care because of the way document indices (and number of lines / characters per line) changes during the course of the edits. The old code would cause the CodeMirror editor and ShareJS document to get out of sync; the new code fixes this problem. See this bug report.

I converted the code back to CoffeeScript, edited that, and compiled to produce new JavaScript. You can also see the CoffeeScript source code. This PR naturally includes #99 as well.

Users: Until this PR and my other PRs get merged, I'd recommend using my fork (meteor add edemaine:sharejs and meteor add edemaine:sharejs-codemirror) which includes all of my PRs.

CodeMirror can stage multiple edits at once, for example, using multiple
cursors (ctrl-click), or updating many numbers at once in Markdown, or
hitting newline before some whitespace at the end of the line.  These multiple
updates need to be handled with care because of the way document indices (and
number of lines / characters per line) changes during the course of the edits.
The old code would cause the CodeMirror editor and ShareJS document to get out
of sync; the new code fixes this problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant