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

Commit

Permalink
Merge pull request #2784 from adobe/rlim/css-insertion-issue
Browse files Browse the repository at this point in the history
Replace range directly in CodeMirror instance insted of using the document.
  • Loading branch information
njx committed Feb 5, 2013
2 parents 94d7fbe + a9baeb9 commit 689038a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/extensions/default/CSSCodeHints/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ define(function (require, exports, module) {
end.ch = start.ch;
}

this.editor.document.replaceRange(hint, 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.
this.editor._codeMirror.replaceRange(hint, start, end);

if (adjustCursor) {
this.editor.setCursorPos(newCursor);
Expand Down

0 comments on commit 689038a

Please sign in to comment.