This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
Fix sync issues when accepting code hint in inline editor #20
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.
Because of adobe/brackets#1688, there is a general bug where edits in a master editor during an operation started in an inline editor cause syncing problems. This happens in the case of EWF code hints as described in #19. In this scenario, when the user hits enter in the code hint menu in an inline editor, the onKeyDown event starts an outer CodeMirror operation(), but EWF then edits the underlying document, which is really the master editor (not the inline editor). This hits the case described in adobe/brackets#1688.
The workaround for now is to simply make it so EWF does its edit in the editor it was called from, not the underlying document. It seems relatively safe and doesn't require changes to core Brackets code.