Support multiple simultaneous CodeMirror edits#100
Open
edemaine wants to merge 1 commit intomizzao:masterfrom
Open
Support multiple simultaneous CodeMirror edits#100edemaine wants to merge 1 commit intomizzao:masterfrom
edemaine wants to merge 1 commit intomizzao:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:sharejsandmeteor add edemaine:sharejs-codemirror) which includes all of my PRs.