Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Use CodeMirror compoundChange to ensure batch operation can be undone #1986

Closed
wants to merge 1 commit into from

Conversation

zanqi
Copy link
Contributor

@zanqi zanqi commented Oct 30, 2012

This is to fix Issue #1957

@RaymondLim
Copy link
Contributor

Your changes do fix the issue in the main editor, but I still can reproduce it in an inliine editor though.

And I found 3 calls to batchOperation -- one from Line Comment and 2 from Move Line Up/Down. Line Comment command does not have the issue even before your changes. So I believe this issue has to do with some selection handling in CodeMirror and probably we won't be able to fix it in Brackets code.

@zanqi
Copy link
Contributor Author

zanqi commented Oct 30, 2012

CodeMirror's batch operation has some weirdness in it due to its operation deferring nature. Need more investigation. Closing.

@zanqi zanqi closed this Oct 30, 2012
@peterflynn
Copy link
Member

@zanqi: note that the batching logic is changing in CodeMirror v3, which we are hoping to migrate to in the next month or so. It might be simplest to wait until then before working on a fix for this (it might even be fixed for free). @njx can give you more details if you're interested.

@TomMalbran TomMalbran mentioned this pull request Nov 11, 2012
@peterflynn
Copy link
Member

We wound up merging basically this exact same change after further testing, in #2132. As far as I can tell it does fix #1957 -- @zanqi, were you seeing cases where this change didn't fix it?

@zanqi
Copy link
Contributor Author

zanqi commented Dec 1, 2012

Looks good. Tested in main editor and inline editor for JavaScript, undo successfully.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants