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

Commit

Permalink
Hack yet another place where we need to use _codeMirror.replaceRange(…
Browse files Browse the repository at this point in the history
…) in code hints to make them work in inline editors because of #1688.
  • Loading branch information
Narciso Jaramillo committed May 3, 2013
1 parent c3b8fd3 commit 984ed97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/extensions/default/JavaScriptCodeHints/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,11 @@ define(function (require, exports, module) {
}
}
// Replace the current token with the completion
session.editor.document.replaceRange(completion, start, end);
// HACK (tracking adobe/brackets#1688): We talk to the private CodeMirror instance
// directly to replace the range instead of using the Document, as we should. The
// reason is due to a flaw in our current document synchronization architecture when
// inline editors are open.
session.editor._codeMirror.replaceRange(completion, start, end);

// Return false to indicate that another hinting session is not needed
return false;
Expand Down

0 comments on commit 984ed97

Please sign in to comment.